summaryrefslogtreecommitdiff
path: root/zebra
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2021-09-24 16:58:27 -0400
committerDonald Sharp <sharpd@nvidia.com>2021-09-27 15:26:05 -0400
commit027db4691747355140e182902ec6412579e43718 (patch)
tree8653cb30fc60196277bcabeda03bda94a627cc55 /zebra
parenta4598b97d93937eead669d406afa91fd070de83b (diff)
lib, zebra: Send safi for rnh resolution
Pass down the safi for when we need address resolution. At this point in time we are hard coding the safi to SAFI_UNICAST. Future commits will take advantage of this. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/zapi_msg.c12
-rw-r--r--zebra/zebra_rnh.c1
-rw-r--r--zebra/zebra_srte.c1
3 files changed, 10 insertions, 4 deletions
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c
index c5f29b8fe7..e0eaaa311b 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 1d33d5f4a4..f5faaab71b 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 d87b3149a6..7933ef66b1 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);