]> git.puffer.fish Git - mirror/frr.git/commitdiff
nhrpd: clean up locals in route zapi api
authorMark Stapp <mjs@labn.net>
Wed, 28 Jun 2023 12:10:40 +0000 (08:10 -0400)
committerMark Stapp <mjs@labn.net>
Mon, 10 Jul 2023 20:43:53 +0000 (16:43 -0400)
Clean up use of a nexthop pointer - seemed inconsistent.

Signed-off-by: Mark Stapp <mjs@labn.net>
nhrpd/nhrp_route.c

index bf7ba5f650bb8d93f3e0cb2b1010af436e5c2030..060e60314d73687a840739d34c80f1d60bdc67c4 100644 (file)
@@ -108,11 +108,10 @@ void nhrp_route_update_nhrp(const struct prefix *p, struct interface *ifp)
 
 void nhrp_route_announce(int add, enum nhrp_cache_type type,
                         const struct prefix *p, struct interface *ifp,
-                        const union sockunion *nexthop, uint32_t mtu)
+                        const union sockunion *nexthop_ref, uint32_t mtu)
 {
        struct zapi_route api;
        struct zapi_nexthop *api_nh;
-       union sockunion *nexthop_ref = (union sockunion *)nexthop;
 
        if (zclient->sock < 0)
                return;
@@ -125,9 +124,10 @@ void nhrp_route_announce(int add, enum nhrp_cache_type type,
 
        switch (type) {
        case NHRP_CACHE_NEGATIVE:
+               /* Fill in a blackhole nexthop */
                zapi_route_set_blackhole(&api, BLACKHOLE_REJECT);
                ifp = NULL;
-               nexthop = NULL;
+               nexthop_ref = NULL;
                break;
        case NHRP_CACHE_DYNAMIC:
        case NHRP_CACHE_NHS: