From e9ac2861e521c2b35ffa1319a6d38fb3453e83a4 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 21 Oct 2021 15:16:21 +0200 Subject: [PATCH] zebra: register NHT nexthops with proper SAFI Just a small puzzle piece missing in zebra SAFI NHT support. Signed-off-by: David Lamparter --- zebra/zapi_msg.c | 2 +- zebra/zebra_rnh.c | 6 +++--- zebra/zebra_rnh.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index e94aee5c1a..fd475e4cee 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -1215,7 +1215,7 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS) p.family); return; } - rnh = zebra_add_rnh(&p, zvrf_id(zvrf), &exist); + rnh = zebra_add_rnh(&p, zvrf_id(zvrf), safi, &exist); if (!rnh) return; diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c index f3f48b52ae..9a2b81bc27 100644 --- a/zebra/zebra_rnh.c +++ b/zebra/zebra_rnh.c @@ -132,13 +132,13 @@ static void zebra_rnh_store_in_routing_table(struct rnh *rnh) route_unlock_node(rn); } -struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid, bool *exists) +struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid, safi_t safi, + bool *exists) { struct route_table *table; struct route_node *rn; struct rnh *rnh = NULL; afi_t afi = family2afi(p->family); - safi_t safi = SAFI_UNICAST; if (IS_ZEBRA_DEBUG_NHT) { struct vrf *vrf = vrf_lookup_by_id(vrfid); @@ -345,7 +345,7 @@ void zebra_register_rnh_pseudowire(vrf_id_t vrf_id, struct zebra_pw *pw, return; addr2hostprefix(pw->af, &pw->nexthop, &nh); - rnh = zebra_add_rnh(&nh, vrf_id, &exists); + rnh = zebra_add_rnh(&nh, vrf_id, SAFI_UNICAST, &exists); if (!rnh) return; diff --git a/zebra/zebra_rnh.h b/zebra/zebra_rnh.h index 27c016ebe6..c8e7dda437 100644 --- a/zebra/zebra_rnh.h +++ b/zebra/zebra_rnh.h @@ -31,7 +31,7 @@ extern "C" { extern void zebra_rnh_init(void); -extern struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid, +extern struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid, safi_t safi, bool *exists); extern struct rnh *zebra_lookup_rnh(struct prefix *p, vrf_id_t vrfid, safi_t safi); -- 2.39.5