]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: register NHT nexthops with proper SAFI
authorDavid Lamparter <equinox@opensourcerouting.org>
Thu, 21 Oct 2021 13:16:21 +0000 (15:16 +0200)
committerDavid Lamparter <equinox@opensourcerouting.org>
Sun, 27 Mar 2022 12:51:00 +0000 (14:51 +0200)
Just a small puzzle piece missing in zebra SAFI NHT support.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
zebra/zapi_msg.c
zebra/zebra_rnh.c
zebra/zebra_rnh.h

index e94aee5c1aefdc26bdeaa926beed1d858c9798aa..fd475e4ceeadc2fb3b1fde48fd449a1c43f0bff9 100644 (file)
@@ -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;
 
index f3f48b52ae21b9e4092003e83eb0d520e4a6f6b1..9a2b81bc27c5a6130c50b18135b74ea0bd72fa5d 100644 (file)
@@ -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;
 
index 27c016ebe60f023dab410b7464217186cf2a8329..c8e7dda4374a41434123d5517e6808df15b1df68 100644 (file)
@@ -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);