summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/zclient.c2
-rw-r--r--zebra/zapi_msg.c12
-rw-r--r--zebra/zebra_rnh.c1
-rw-r--r--zebra/zebra_srte.c1
4 files changed, 12 insertions, 4 deletions
diff --git a/lib/zclient.c b/lib/zclient.c
index 6f863c5ea..d639fa84b 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -775,6 +775,7 @@ enum zclient_send_status zclient_send_rnh(struct zclient *zclient, int command,
zclient_create_header(s, command, vrf_id);
stream_putc(s, (connected) ? 1 : 0);
stream_putc(s, (resolve_via_def) ? 1 : 0);
+ stream_putw(s, SAFI_UNICAST);
stream_putw(s, PREFIX_FAMILY(p));
stream_putc(s, p->prefixlen);
switch (PREFIX_FAMILY(p)) {
@@ -1926,6 +1927,7 @@ bool zapi_nexthop_update_decode(struct stream *s, struct zapi_route *nhr)
memset(nhr, 0, sizeof(*nhr));
STREAM_GETL(s, nhr->message);
+ STREAM_GETW(s, nhr->safi);
STREAM_GETW(s, nhr->prefix.family);
STREAM_GETC(s, nhr->prefix.prefixlen);
switch (nhr->prefix.family) {
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c
index c5f29b8fe..e0eaaa311 100644
--- a/zebra/zapi_msg.c
+++ b/zebra/zapi_msg.c
@@ -1176,6 +1176,7 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
bool exist;
bool flag_changed = false;
uint8_t orig_flags;
+ safi_t safi;
if (IS_ZEBRA_DEBUG_NHT)
zlog_debug(
@@ -1191,9 +1192,10 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
while (l < hdr->length) {
STREAM_GETC(s, connected);
STREAM_GETC(s, resolve_via_default);
+ STREAM_GETW(s, safi);
STREAM_GETW(s, p.family);
STREAM_GETC(s, p.prefixlen);
- l += 5;
+ l += 7;
if (p.family == AF_INET) {
client->v4_nh_watch_add_cnt++;
if (p.prefixlen > IPV4_MAX_BITLEN) {
@@ -1241,7 +1243,7 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
/* Anything not AF_INET/INET6 has been filtered out above */
if (!exist || flag_changed)
zebra_evaluate_rnh(zvrf, family2afi(p.family), 1, &p,
- SAFI_UNICAST);
+ safi);
zebra_add_rnh_client(rnh, client, zvrf_id(zvrf));
}
@@ -1257,6 +1259,7 @@ static void zread_rnh_unregister(ZAPI_HANDLER_ARGS)
struct stream *s;
struct prefix p;
unsigned short l = 0;
+ safi_t safi;
if (IS_ZEBRA_DEBUG_NHT)
zlog_debug(
@@ -1276,9 +1279,10 @@ static void zread_rnh_unregister(ZAPI_HANDLER_ARGS)
if (ignore != 0)
goto stream_failure;
+ STREAM_GETW(s, safi);
STREAM_GETW(s, p.family);
STREAM_GETC(s, p.prefixlen);
- l += 5;
+ l += 7;
if (p.family == AF_INET) {
client->v4_nh_watch_rem_cnt++;
if (p.prefixlen > IPV4_MAX_BITLEN) {
@@ -1306,7 +1310,7 @@ static void zread_rnh_unregister(ZAPI_HANDLER_ARGS)
p.family);
return;
}
- rnh = zebra_lookup_rnh(&p, zvrf_id(zvrf), SAFI_UNICAST);
+ rnh = zebra_lookup_rnh(&p, zvrf_id(zvrf), safi);
if (rnh) {
client->nh_dereg_time = monotime(NULL);
zebra_remove_rnh_client(rnh, client);
diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c
index 1d33d5f4a..f5faaab71 100644
--- a/zebra/zebra_rnh.c
+++ b/zebra/zebra_rnh.c
@@ -1173,6 +1173,7 @@ int zebra_send_rnh_update(struct rnh *rnh, struct zserv *client,
SET_FLAG(message, ZAPI_MESSAGE_SRTE);
stream_putl(s, message);
+ stream_putw(s, rnh->safi);
stream_putw(s, rn->p.family);
switch (rn->p.family) {
case AF_INET:
diff --git a/zebra/zebra_srte.c b/zebra/zebra_srte.c
index d87b3149a..7933ef66b 100644
--- a/zebra/zebra_srte.c
+++ b/zebra/zebra_srte.c
@@ -116,6 +116,7 @@ static int zebra_sr_policy_notify_update_client(struct zebra_sr_policy *policy,
SET_FLAG(message, ZAPI_MESSAGE_SRTE);
stream_putl(s, message);
+ stream_putw(s, SAFI_UNICAST);
switch (policy->endpoint.ipa_type) {
case IPADDR_V4:
stream_putw(s, AF_INET);