summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/user/zebra.rst9
-rw-r--r--ospf6d/ospf6_spf.c4
-rw-r--r--zebra/zapi_msg.c6
-rw-r--r--zebra/zebra_dplane.c4
-rw-r--r--zebra/zebra_pbr.h2
5 files changed, 21 insertions, 4 deletions
diff --git a/doc/user/zebra.rst b/doc/user/zebra.rst
index de327dfe21..789b5bf3c0 100644
--- a/doc/user/zebra.rst
+++ b/doc/user/zebra.rst
@@ -1353,6 +1353,15 @@ Optional sysctl settings
When ndisc_notify is set to 0, no U-NA is sent.
When ndisc_notify is set to 1, a U-NA is sent when the interface comes UP.
+Useful sysctl settings
+----------------------
+
+.. option:: net.ipv6.conf.all.use_oif_addrs_only=1
+
+ When enabled, the candidate source addresses for destinations routed via this interface are
+ restricted to the set of addresses configured on this interface (RFC 6724 section 4). If
+ an operator has hundreds of IP addresses per interface this solves the latency problem.
+
Debugging
=========
diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c
index a9bd7febcf..f9c47cbce5 100644
--- a/ospf6d/ospf6_spf.c
+++ b/ospf6d/ospf6_spf.c
@@ -461,6 +461,10 @@ void ospf6_spf_reason_string(uint32_t reason, char *buf, int size)
if (!buf)
return;
+ if (!reason) {
+ buf[0] = '\0';
+ return;
+ }
for (bit = 0; bit < array_size(ospf6_spf_reason_str); bit++) {
if ((reason & (1 << bit)) && (len < size)) {
len += snprintf((buf + len), (size - len), "%s%s",
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c
index 61bd1417d1..166c50ac0e 100644
--- a/zebra/zapi_msg.c
+++ b/zebra/zapi_msg.c
@@ -893,7 +893,7 @@ void zsend_iptable_notify_owner(const struct zebra_dplane_ctx *ctx,
s = stream_new(ZEBRA_MAX_PACKET_SIZ);
zclient_create_header(s, cmd, VRF_DEFAULT);
- stream_put(s, &note, sizeof(note));
+ stream_putw(s, note);
stream_putl(s, ipt.unique);
stream_put(s, ipt.ipset_name, ZEBRA_IPSET_NAME_SIZE);
stream_putw_at(s, 0, stream_get_endp(s));
@@ -928,7 +928,7 @@ void zsend_ipset_notify_owner(const struct zebra_dplane_ctx *ctx,
s = stream_new(ZEBRA_MAX_PACKET_SIZ);
zclient_create_header(s, cmd, VRF_DEFAULT);
- stream_put(s, &note, sizeof(note));
+ stream_putw(s, note);
stream_putl(s, ipset.unique);
stream_put(s, ipset.ipset_name, ZEBRA_IPSET_NAME_SIZE);
stream_putw_at(s, 0, stream_get_endp(s));
@@ -966,7 +966,7 @@ void zsend_ipset_entry_notify_owner(const struct zebra_dplane_ctx *ctx,
s = stream_new(ZEBRA_MAX_PACKET_SIZ);
zclient_create_header(s, cmd, VRF_DEFAULT);
- stream_put(s, &note, sizeof(note));
+ stream_putw(s, note);
stream_putl(s, ipent.unique);
stream_put(s, ipset.ipset_name, ZEBRA_IPSET_NAME_SIZE);
stream_putw_at(s, 0, stream_get_endp(s));
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c
index 9e9844390d..3d258e0829 100644
--- a/zebra/zebra_dplane.c
+++ b/zebra/zebra_dplane.c
@@ -341,7 +341,7 @@ struct zebra_dplane_ctx {
struct dplane_rule_info rule;
struct zebra_pbr_iptable iptable;
struct zebra_pbr_ipset ipset;
- union {
+ struct {
struct zebra_pbr_ipset_entry entry;
struct zebra_pbr_ipset_info info;
} ipset_entry;
@@ -2166,6 +2166,7 @@ bool dplane_ctx_get_pbr_ipset(const struct zebra_dplane_ctx *ctx,
ctx->zd_op == DPLANE_OP_IPSET_ENTRY_DELETE) {
memset(ipset, 0, sizeof(struct zebra_pbr_ipset));
ipset->type = ctx->u.ipset_entry.info.type;
+ ipset->family = ctx->u.ipset_entry.info.family;
memcpy(&ipset->ipset_name, &ctx->u.ipset_entry.info.ipset_name,
ZEBRA_IPSET_NAME_SIZE);
} else
@@ -2943,6 +2944,7 @@ dplane_ctx_ipset_entry_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op,
sizeof(struct zebra_pbr_ipset_entry));
ctx->u.ipset_entry.entry.backpointer = NULL;
ctx->u.ipset_entry.info.type = ipset->type;
+ ctx->u.ipset_entry.info.family = ipset->family;
memcpy(&ctx->u.ipset_entry.info.ipset_name, &ipset->ipset_name,
ZEBRA_IPSET_NAME_SIZE);
diff --git a/zebra/zebra_pbr.h b/zebra/zebra_pbr.h
index 2e9658e7e5..c5102df4fa 100644
--- a/zebra/zebra_pbr.h
+++ b/zebra/zebra_pbr.h
@@ -70,6 +70,8 @@ struct zebra_pbr_ipset_info {
*/
uint32_t type;
+ uint8_t family;
+
char ipset_name[ZEBRA_IPSET_NAME_SIZE];
};