mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-29 02:37:00 +00:00
*: add SAFI argument to zclient_send_rnh
Just pushing that SAFI_UNICAST up 1 level to the caller. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
6c90403bb1
commit
eb3c9d9774
@ -889,8 +889,9 @@ static void sendmsg_zebra_rnh(struct bgp_nexthop_cache *bnc, int command)
|
|||||||
zserv_command_string(command), &bnc->prefix,
|
zserv_command_string(command), &bnc->prefix,
|
||||||
bnc->bgp->name_pretty);
|
bnc->bgp->name_pretty);
|
||||||
|
|
||||||
ret = zclient_send_rnh(zclient, command, &bnc->prefix, exact_match,
|
ret = zclient_send_rnh(zclient, command, &bnc->prefix, SAFI_UNICAST,
|
||||||
resolve_via_default, bnc->bgp->vrf_id);
|
exact_match, resolve_via_default,
|
||||||
|
bnc->bgp->vrf_id);
|
||||||
if (ret == ZCLIENT_SEND_FAILURE) {
|
if (ret == ZCLIENT_SEND_FAILURE) {
|
||||||
flog_warn(EC_BGP_ZEBRA_SEND,
|
flog_warn(EC_BGP_ZEBRA_SEND,
|
||||||
"sendmsg_nexthop: zclient_send_message() failed");
|
"sendmsg_nexthop: zclient_send_message() failed");
|
||||||
|
@ -768,9 +768,9 @@ static void zclient_connect(struct thread *t)
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum zclient_send_status zclient_send_rnh(struct zclient *zclient, int command,
|
enum zclient_send_status zclient_send_rnh(struct zclient *zclient, int command,
|
||||||
const struct prefix *p,
|
const struct prefix *p, safi_t safi,
|
||||||
bool connected,
|
bool connected, bool resolve_via_def,
|
||||||
bool resolve_via_def, vrf_id_t vrf_id)
|
vrf_id_t vrf_id)
|
||||||
{
|
{
|
||||||
struct stream *s;
|
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);
|
zclient_create_header(s, command, vrf_id);
|
||||||
stream_putc(s, (connected) ? 1 : 0);
|
stream_putc(s, (connected) ? 1 : 0);
|
||||||
stream_putc(s, (resolve_via_def) ? 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_putw(s, PREFIX_FAMILY(p));
|
||||||
stream_putc(s, p->prefixlen);
|
stream_putc(s, p->prefixlen);
|
||||||
switch (PREFIX_FAMILY(p)) {
|
switch (PREFIX_FAMILY(p)) {
|
||||||
|
@ -1071,7 +1071,8 @@ extern enum zclient_send_status zclient_route_send(uint8_t, struct zclient *,
|
|||||||
struct zapi_route *);
|
struct zapi_route *);
|
||||||
extern enum zclient_send_status
|
extern enum zclient_send_status
|
||||||
zclient_send_rnh(struct zclient *zclient, int command, const struct prefix *p,
|
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,
|
int zapi_nexthop_encode(struct stream *s, const struct zapi_nexthop *api_nh,
|
||||||
uint32_t api_flags, uint32_t api_message);
|
uint32_t api_flags, uint32_t api_message);
|
||||||
extern int zapi_route_encode(uint8_t, struct stream *, struct zapi_route *);
|
extern int zapi_route_encode(uint8_t, struct stream *, struct zapi_route *);
|
||||||
|
@ -155,8 +155,8 @@ void ospf6_zebra_import_default_route(struct ospf6 *ospf6, bool unreg)
|
|||||||
zserv_command_string(command), &prefix,
|
zserv_command_string(command), &prefix,
|
||||||
ospf6->vrf_id);
|
ospf6->vrf_id);
|
||||||
|
|
||||||
if (zclient_send_rnh(zclient, command, &prefix, false, true,
|
if (zclient_send_rnh(zclient, command, &prefix, SAFI_UNICAST, false,
|
||||||
ospf6->vrf_id)
|
true, ospf6->vrf_id)
|
||||||
== ZCLIENT_SEND_FAILURE)
|
== ZCLIENT_SEND_FAILURE)
|
||||||
flog_err(EC_LIB_ZAPI_SOCKET, "%s: zclient_send_rnh() failed",
|
flog_err(EC_LIB_ZAPI_SOCKET, "%s: zclient_send_rnh() failed",
|
||||||
__func__);
|
__func__);
|
||||||
|
@ -485,7 +485,8 @@ void pbr_send_rnh(struct nexthop *nhop, bool reg)
|
|||||||
break;
|
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) {
|
== ZCLIENT_SEND_FAILURE) {
|
||||||
zlog_warn("%s: Failure to send nexthop to zebra", __func__);
|
zlog_warn("%s: Failure to send nexthop to zebra", __func__);
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ void pim_sendmsg_zebra_rnh(struct pim_instance *pim, struct zclient *zclient,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
p = &(pnc->rpf.rpf_addr);
|
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);
|
pim->vrf->vrf_id);
|
||||||
if (ret == ZCLIENT_SEND_FAILURE)
|
if (ret == ZCLIENT_SEND_FAILURE)
|
||||||
zlog_warn("sendmsg_nexthop: zclient_send_message() failed");
|
zlog_warn("sendmsg_nexthop: zclient_send_message() failed");
|
||||||
|
@ -631,7 +631,8 @@ void sharp_zebra_nexthop_watch(struct prefix *p, vrf_id_t vrf_id, bool import,
|
|||||||
if (!watch)
|
if (!watch)
|
||||||
command = ZEBRA_NEXTHOP_UNREGISTER;
|
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)
|
== ZCLIENT_SEND_FAILURE)
|
||||||
zlog_warn("%s: Failure to send nexthop to zebra", __func__);
|
zlog_warn("%s: Failure to send nexthop to zebra", __func__);
|
||||||
}
|
}
|
||||||
|
@ -330,8 +330,8 @@ void static_zebra_nht_register(struct static_nexthop *nh, bool reg)
|
|||||||
DEBUGD(&static_dbg_route, "%s nexthop(%pFX) for %pRN",
|
DEBUGD(&static_dbg_route, "%s nexthop(%pFX) for %pRN",
|
||||||
reg ? "Registering" : "Unregistering", &p, rn);
|
reg ? "Registering" : "Unregistering", &p, rn);
|
||||||
|
|
||||||
if (zclient_send_rnh(zclient, cmd, &p, false, false, nh->nh_vrf_id)
|
if (zclient_send_rnh(zclient, cmd, &p, SAFI_UNICAST, false, false,
|
||||||
== ZCLIENT_SEND_FAILURE)
|
nh->nh_vrf_id) == ZCLIENT_SEND_FAILURE)
|
||||||
zlog_warn("%s: Failure to send nexthop to zebra", __func__);
|
zlog_warn("%s: Failure to send nexthop to zebra", __func__);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user