]> git.puffer.fish Git - matthieu/frr.git/commitdiff
*: add SAFI argument to zclient_send_rnh
authorDavid Lamparter <equinox@opensourcerouting.org>
Mon, 4 Oct 2021 10:21:45 +0000 (12:21 +0200)
committerDavid Lamparter <equinox@opensourcerouting.org>
Sun, 27 Mar 2022 12:57:22 +0000 (14:57 +0200)
Just pushing that SAFI_UNICAST up 1 level to the caller.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
bgpd/bgp_nht.c
lib/zclient.c
lib/zclient.h
ospf6d/ospf6_zebra.c
pbrd/pbr_zebra.c
pimd/pim_nht.c
sharpd/sharp_zebra.c
staticd/static_zebra.c

index d768733545e1fd4e96097c672b44578b105c8787..d3ebc0e6a26771ee27b8f9bfdc33d7e8c9231fbc 100644 (file)
@@ -889,8 +889,9 @@ static void sendmsg_zebra_rnh(struct bgp_nexthop_cache *bnc, int command)
                           zserv_command_string(command), &bnc->prefix,
                           bnc->bgp->name_pretty);
 
-       ret = zclient_send_rnh(zclient, command, &bnc->prefix, exact_match,
-                              resolve_via_default, bnc->bgp->vrf_id);
+       ret = zclient_send_rnh(zclient, command, &bnc->prefix, SAFI_UNICAST,
+                              exact_match, resolve_via_default,
+                              bnc->bgp->vrf_id);
        if (ret == ZCLIENT_SEND_FAILURE) {
                flog_warn(EC_BGP_ZEBRA_SEND,
                          "sendmsg_nexthop: zclient_send_message() failed");
index f6c5a8af08fbd6f9da01a0698d97d475dc2d7eb9..0c34214151b88c2be968700a10219bfb154091bb 100644 (file)
@@ -768,9 +768,9 @@ static void zclient_connect(struct thread *t)
 }
 
 enum zclient_send_status zclient_send_rnh(struct zclient *zclient, int command,
-                                         const struct prefix *p,
-                                         bool connected,
-                                         bool resolve_via_def, vrf_id_t vrf_id)
+                                         const struct prefix *p, safi_t safi,
+                                         bool connected, bool resolve_via_def,
+                                         vrf_id_t vrf_id)
 {
        struct stream *s;
 
@@ -779,7 +779,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, safi);
        stream_putw(s, PREFIX_FAMILY(p));
        stream_putc(s, p->prefixlen);
        switch (PREFIX_FAMILY(p)) {
index 092754f6026255b429ff9ab5df92a486c81de12c..7e1283d830aad04376122b985e0bcb148bd67dda 100644 (file)
@@ -1071,7 +1071,8 @@ extern enum zclient_send_status zclient_route_send(uint8_t, struct zclient *,
                                                   struct zapi_route *);
 extern enum zclient_send_status
 zclient_send_rnh(struct zclient *zclient, int command, const struct prefix *p,
-                bool connected, bool resolve_via_default, vrf_id_t vrf_id);
+                safi_t safi, bool connected, bool resolve_via_default,
+                vrf_id_t vrf_id);
 int zapi_nexthop_encode(struct stream *s, const struct zapi_nexthop *api_nh,
                        uint32_t api_flags, uint32_t api_message);
 extern int zapi_route_encode(uint8_t, struct stream *, struct zapi_route *);
index 4b37c5bc208bf6aa408bf4b262e3ee06ba9214a5..18b1959b9b6d9bbf2ef559004c5fe917002175d1 100644 (file)
@@ -155,8 +155,8 @@ void ospf6_zebra_import_default_route(struct ospf6 *ospf6, bool unreg)
                           zserv_command_string(command), &prefix,
                           ospf6->vrf_id);
 
-       if (zclient_send_rnh(zclient, command, &prefix, false, true,
-                            ospf6->vrf_id)
+       if (zclient_send_rnh(zclient, command, &prefix, SAFI_UNICAST, false,
+                            true, ospf6->vrf_id)
            == ZCLIENT_SEND_FAILURE)
                flog_err(EC_LIB_ZAPI_SOCKET, "%s: zclient_send_rnh() failed",
                         __func__);
index f992588729c33888ad98088e8a2ada36a96dbc59..da4e3e1bc078d6d7302b19faf1f44563aab746b2 100644 (file)
@@ -485,7 +485,8 @@ void pbr_send_rnh(struct nexthop *nhop, bool reg)
                break;
        }
 
-       if (zclient_send_rnh(zclient, command, &p, false, false, nhop->vrf_id)
+       if (zclient_send_rnh(zclient, command, &p, SAFI_UNICAST, false, false,
+                            nhop->vrf_id)
            == ZCLIENT_SEND_FAILURE) {
                zlog_warn("%s: Failure to send nexthop to zebra", __func__);
        }
index 753857005a05556462c67e8c89b9b69b21370161..94dcfb826558ee85cc8da4423f53907719623948 100644 (file)
@@ -55,7 +55,7 @@ void pim_sendmsg_zebra_rnh(struct pim_instance *pim, struct zclient *zclient,
        int ret;
 
        p = &(pnc->rpf.rpf_addr);
-       ret = zclient_send_rnh(zclient, command, p, false, false,
+       ret = zclient_send_rnh(zclient, command, p, SAFI_UNICAST, false, false,
                               pim->vrf->vrf_id);
        if (ret == ZCLIENT_SEND_FAILURE)
                zlog_warn("sendmsg_nexthop: zclient_send_message() failed");
index 52364bff41eb949ed7580e5a6b52c0405c373c18..b40c2c6228c941298f9bd34932351f6ef294fec0 100644 (file)
@@ -631,7 +631,8 @@ void sharp_zebra_nexthop_watch(struct prefix *p, vrf_id_t vrf_id, bool import,
        if (!watch)
                command = ZEBRA_NEXTHOP_UNREGISTER;
 
-       if (zclient_send_rnh(zclient, command, p, connected, false, vrf_id)
+       if (zclient_send_rnh(zclient, command, p, SAFI_UNICAST, connected,
+                            false, vrf_id)
            == ZCLIENT_SEND_FAILURE)
                zlog_warn("%s: Failure to send nexthop to zebra", __func__);
 }
index bd293edebc15ae0cdb0af7d0828f2154588fc2f8..ea17435b23781e3b086096edcc88d2a47af74134 100644 (file)
@@ -330,8 +330,8 @@ void static_zebra_nht_register(struct static_nexthop *nh, bool reg)
        DEBUGD(&static_dbg_route, "%s nexthop(%pFX) for %pRN",
               reg ? "Registering" : "Unregistering", &p, rn);
 
-       if (zclient_send_rnh(zclient, cmd, &p, false, false, nh->nh_vrf_id)
-           == ZCLIENT_SEND_FAILURE)
+       if (zclient_send_rnh(zclient, cmd, &p, SAFI_UNICAST, false, false,
+                            nh->nh_vrf_id) == ZCLIENT_SEND_FAILURE)
                zlog_warn("%s: Failure to send nexthop to zebra", __func__);
 }
 /*