forked from Mirror/frr
bgpd: clean up variable-shadowing compiler warnings
Clean up -Wshadow warnings in bgp. Signed-off-by: Mark Stapp <mjs@cisco.com>
This commit is contained in:
parent
aece400f10
commit
660cbf5651
|
@ -1444,11 +1444,11 @@ bgp_attr_malformed(struct bgp_attr_parser_args *args, uint8_t subcode,
|
||||||
uint8_t *notify_datap = (length > 0 ? args->startp : NULL);
|
uint8_t *notify_datap = (length > 0 ? args->startp : NULL);
|
||||||
|
|
||||||
if (bgp_debug_update(peer, NULL, NULL, 1)) {
|
if (bgp_debug_update(peer, NULL, NULL, 1)) {
|
||||||
char attr_str[BUFSIZ] = {0};
|
char str[BUFSIZ] = { 0 };
|
||||||
|
|
||||||
bgp_dump_attr(attr, attr_str, sizeof(attr_str));
|
bgp_dump_attr(attr, str, sizeof(str));
|
||||||
|
|
||||||
zlog_debug("%s: attributes: %s", __func__, attr_str);
|
zlog_debug("%s: attributes: %s", __func__, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Only relax error handling for eBGP peers */
|
/* Only relax error handling for eBGP peers */
|
||||||
|
@ -2043,11 +2043,11 @@ static int bgp_attr_aggregator(struct bgp_attr_parser_args *args)
|
||||||
peer->host, aspath_print(attr->aspath));
|
peer->host, aspath_print(attr->aspath));
|
||||||
|
|
||||||
if (bgp_debug_update(peer, NULL, NULL, 1)) {
|
if (bgp_debug_update(peer, NULL, NULL, 1)) {
|
||||||
char attr_str[BUFSIZ] = {0};
|
char str[BUFSIZ] = { 0 };
|
||||||
|
|
||||||
bgp_dump_attr(attr, attr_str, sizeof(attr_str));
|
bgp_dump_attr(attr, str, sizeof(str));
|
||||||
|
|
||||||
zlog_debug("%s: attributes: %s", __func__, attr_str);
|
zlog_debug("%s: attributes: %s", __func__, str);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
SET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_AGGREGATOR));
|
SET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_AGGREGATOR));
|
||||||
|
@ -2094,11 +2094,11 @@ bgp_attr_as4_aggregator(struct bgp_attr_parser_args *args,
|
||||||
peer->host, aspath_print(attr->aspath));
|
peer->host, aspath_print(attr->aspath));
|
||||||
|
|
||||||
if (bgp_debug_update(peer, NULL, NULL, 1)) {
|
if (bgp_debug_update(peer, NULL, NULL, 1)) {
|
||||||
char attr_str[BUFSIZ] = {0};
|
char str[BUFSIZ] = { 0 };
|
||||||
|
|
||||||
bgp_dump_attr(attr, attr_str, sizeof(attr_str));
|
bgp_dump_attr(attr, str, sizeof(str));
|
||||||
|
|
||||||
zlog_debug("%s: attributes: %s", __func__, attr_str);
|
zlog_debug("%s: attributes: %s", __func__, str);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
SET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_AS4_AGGREGATOR));
|
SET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_AS4_AGGREGATOR));
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
DEFINE_MTYPE_STATIC(BGPD, BFD_CONFIG, "BFD configuration data");
|
DEFINE_MTYPE_STATIC(BGPD, BFD_CONFIG, "BFD configuration data");
|
||||||
|
|
||||||
extern struct zclient *zclient;
|
extern struct zclient *bgp_zclient;
|
||||||
|
|
||||||
static void bfd_session_status_update(struct bfd_session_params *bsp,
|
static void bfd_session_status_update(struct bfd_session_params *bsp,
|
||||||
const struct bfd_session_status *bss,
|
const struct bfd_session_status *bss,
|
||||||
|
@ -651,7 +651,7 @@ DEFUN(no_neighbor_bfd_profile, no_neighbor_bfd_profile_cmd,
|
||||||
void bgp_bfd_init(struct event_loop *tm)
|
void bgp_bfd_init(struct event_loop *tm)
|
||||||
{
|
{
|
||||||
/* Initialize BFD client functions */
|
/* Initialize BFD client functions */
|
||||||
bfd_protocol_integration_init(zclient, tm);
|
bfd_protocol_integration_init(bgp_zclient, tm);
|
||||||
|
|
||||||
/* "neighbor bfd" commands. */
|
/* "neighbor bfd" commands. */
|
||||||
install_element(BGP_NODE, &neighbor_bfd_cmd);
|
install_element(BGP_NODE, &neighbor_bfd_cmd);
|
||||||
|
|
|
@ -1441,14 +1441,14 @@ static char *_ecommunity_ecom2str(struct ecommunity *ecom, int format, int filte
|
||||||
snprintf(encbuf, sizeof(encbuf), "FS:action %s",
|
snprintf(encbuf, sizeof(encbuf), "FS:action %s",
|
||||||
action);
|
action);
|
||||||
} else if (sub_type == ECOMMUNITY_TRAFFIC_RATE) {
|
} else if (sub_type == ECOMMUNITY_TRAFFIC_RATE) {
|
||||||
union traffic_rate data;
|
union traffic_rate rate;
|
||||||
|
|
||||||
data.rate_byte[3] = *(pnt+2);
|
rate.rate_byte[3] = *(pnt + 2);
|
||||||
data.rate_byte[2] = *(pnt+3);
|
rate.rate_byte[2] = *(pnt + 3);
|
||||||
data.rate_byte[1] = *(pnt+4);
|
rate.rate_byte[1] = *(pnt + 4);
|
||||||
data.rate_byte[0] = *(pnt+5);
|
rate.rate_byte[0] = *(pnt + 5);
|
||||||
snprintf(encbuf, sizeof(encbuf), "FS:rate %f",
|
snprintf(encbuf, sizeof(encbuf), "FS:rate %f",
|
||||||
data.rate_float);
|
rate.rate_float);
|
||||||
} else if (sub_type == ECOMMUNITY_TRAFFIC_MARKING) {
|
} else if (sub_type == ECOMMUNITY_TRAFFIC_MARKING) {
|
||||||
snprintf(encbuf, sizeof(encbuf),
|
snprintf(encbuf, sizeof(encbuf),
|
||||||
"FS:marking %u", *(pnt + 5));
|
"FS:marking %u", *(pnt + 5));
|
||||||
|
|
|
@ -905,7 +905,7 @@ static enum zclient_send_status bgp_zebra_send_remote_macip(
|
||||||
bool esi_valid;
|
bool esi_valid;
|
||||||
|
|
||||||
/* Check socket. */
|
/* Check socket. */
|
||||||
if (!zclient || zclient->sock < 0) {
|
if (!bgp_zclient || bgp_zclient->sock < 0) {
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: No zclient or zclient->sock exists",
|
zlog_debug("%s: No zclient or zclient->sock exists",
|
||||||
__func__);
|
__func__);
|
||||||
|
@ -923,7 +923,7 @@ static enum zclient_send_status bgp_zebra_send_remote_macip(
|
||||||
|
|
||||||
if (!esi)
|
if (!esi)
|
||||||
esi = zero_esi;
|
esi = zero_esi;
|
||||||
s = zclient->obuf;
|
s = bgp_zclient->obuf;
|
||||||
stream_reset(s);
|
stream_reset(s);
|
||||||
|
|
||||||
zclient_create_header(
|
zclient_create_header(
|
||||||
|
@ -984,7 +984,7 @@ static enum zclient_send_status bgp_zebra_send_remote_macip(
|
||||||
frrtrace(5, frr_bgp, evpn_mac_ip_zsend, add, vpn, p, remote_vtep_ip,
|
frrtrace(5, frr_bgp, evpn_mac_ip_zsend, add, vpn, p, remote_vtep_ip,
|
||||||
esi);
|
esi);
|
||||||
|
|
||||||
return zclient_send_message(zclient);
|
return zclient_send_message(bgp_zclient);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -998,7 +998,7 @@ bgp_zebra_send_remote_vtep(struct bgp *bgp, struct bgpevpn *vpn,
|
||||||
struct stream *s;
|
struct stream *s;
|
||||||
|
|
||||||
/* Check socket. */
|
/* Check socket. */
|
||||||
if (!zclient || zclient->sock < 0) {
|
if (!bgp_zclient || bgp_zclient->sock < 0) {
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: No zclient or zclient->sock exists",
|
zlog_debug("%s: No zclient or zclient->sock exists",
|
||||||
__func__);
|
__func__);
|
||||||
|
@ -1014,7 +1014,7 @@ bgp_zebra_send_remote_vtep(struct bgp *bgp, struct bgpevpn *vpn,
|
||||||
return ZCLIENT_SEND_SUCCESS;
|
return ZCLIENT_SEND_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
s = zclient->obuf;
|
s = bgp_zclient->obuf;
|
||||||
stream_reset(s);
|
stream_reset(s);
|
||||||
|
|
||||||
zclient_create_header(
|
zclient_create_header(
|
||||||
|
@ -1041,7 +1041,7 @@ bgp_zebra_send_remote_vtep(struct bgp *bgp, struct bgpevpn *vpn,
|
||||||
|
|
||||||
frrtrace(3, frr_bgp, evpn_bum_vtep_zsend, add, vpn, p);
|
frrtrace(3, frr_bgp, evpn_bum_vtep_zsend, add, vpn, p);
|
||||||
|
|
||||||
return zclient_send_message(zclient);
|
return zclient_send_message(bgp_zclient);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1387,7 +1387,7 @@ bgp_zebra_send_remote_es_vtep(struct bgp *bgp, struct bgp_evpn_es_vtep *es_vtep,
|
||||||
uint32_t flags = 0;
|
uint32_t flags = 0;
|
||||||
|
|
||||||
/* Check socket. */
|
/* Check socket. */
|
||||||
if (!zclient || zclient->sock < 0) {
|
if (!bgp_zclient || bgp_zclient->sock < 0) {
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: No zclient or zclient->sock exists",
|
zlog_debug("%s: No zclient or zclient->sock exists",
|
||||||
__func__);
|
__func__);
|
||||||
|
@ -1405,7 +1405,7 @@ bgp_zebra_send_remote_es_vtep(struct bgp *bgp, struct bgp_evpn_es_vtep *es_vtep,
|
||||||
if (CHECK_FLAG(es_vtep->flags, BGP_EVPNES_VTEP_ESR))
|
if (CHECK_FLAG(es_vtep->flags, BGP_EVPNES_VTEP_ESR))
|
||||||
SET_FLAG(flags, ZAPI_ES_VTEP_FLAG_ESR_RXED);
|
SET_FLAG(flags, ZAPI_ES_VTEP_FLAG_ESR_RXED);
|
||||||
|
|
||||||
s = zclient->obuf;
|
s = bgp_zclient->obuf;
|
||||||
stream_reset(s);
|
stream_reset(s);
|
||||||
|
|
||||||
zclient_create_header(s,
|
zclient_create_header(s,
|
||||||
|
@ -1427,7 +1427,7 @@ bgp_zebra_send_remote_es_vtep(struct bgp *bgp, struct bgp_evpn_es_vtep *es_vtep,
|
||||||
|
|
||||||
frrtrace(3, frr_bgp, evpn_mh_vtep_zsend, add, es, es_vtep);
|
frrtrace(3, frr_bgp, evpn_mh_vtep_zsend, add, es, es_vtep);
|
||||||
|
|
||||||
return zclient_send_message(zclient);
|
return zclient_send_message(bgp_zclient);
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum zclient_send_status bgp_evpn_es_vtep_re_eval_active(
|
static enum zclient_send_status bgp_evpn_es_vtep_re_eval_active(
|
||||||
|
@ -2876,7 +2876,7 @@ static void bgp_evpn_l3nhg_zebra_add_v4_or_v6(struct bgp_evpn_es_vrf *es_vrf,
|
||||||
if (!api_nhg.nexthop_num)
|
if (!api_nhg.nexthop_num)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
zclient_nhg_send(zclient, ZEBRA_NHG_ADD, &api_nhg);
|
zclient_nhg_send(bgp_zclient, ZEBRA_NHG_ADD, &api_nhg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool bgp_evpn_l3nhg_zebra_ok(struct bgp_evpn_es_vrf *es_vrf)
|
static bool bgp_evpn_l3nhg_zebra_ok(struct bgp_evpn_es_vrf *es_vrf)
|
||||||
|
@ -2885,7 +2885,7 @@ static bool bgp_evpn_l3nhg_zebra_ok(struct bgp_evpn_es_vrf *es_vrf)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* Check socket. */
|
/* Check socket. */
|
||||||
if (!zclient || zclient->sock < 0)
|
if (!bgp_zclient || bgp_zclient->sock < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -2920,7 +2920,7 @@ static void bgp_evpn_l3nhg_zebra_del_v4_or_v6(struct bgp_evpn_es_vrf *es_vrf,
|
||||||
frrtrace(4, frr_bgp, evpn_mh_nhg_zsend, false, v4_nhg, api_nhg.id,
|
frrtrace(4, frr_bgp, evpn_mh_nhg_zsend, false, v4_nhg, api_nhg.id,
|
||||||
es_vrf);
|
es_vrf);
|
||||||
|
|
||||||
zclient_nhg_send(zclient, ZEBRA_NHG_DEL, &api_nhg);
|
zclient_nhg_send(bgp_zclient, ZEBRA_NHG_DEL, &api_nhg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bgp_evpn_l3nhg_zebra_del(struct bgp_evpn_es_vrf *es_vrf)
|
static void bgp_evpn_l3nhg_zebra_del(struct bgp_evpn_es_vrf *es_vrf)
|
||||||
|
@ -4476,7 +4476,7 @@ static void bgp_evpn_nh_zebra_update_send(struct bgp_evpn_nh *nh, bool add)
|
||||||
struct bgp *bgp_vrf = nh->bgp_vrf;
|
struct bgp *bgp_vrf = nh->bgp_vrf;
|
||||||
|
|
||||||
/* Check socket. */
|
/* Check socket. */
|
||||||
if (!zclient || zclient->sock < 0)
|
if (!bgp_zclient || bgp_zclient->sock < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Don't try to register if Zebra doesn't know of this instance. */
|
/* Don't try to register if Zebra doesn't know of this instance. */
|
||||||
|
@ -4487,7 +4487,7 @@ static void bgp_evpn_nh_zebra_update_send(struct bgp_evpn_nh *nh, bool add)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
s = zclient->obuf;
|
s = bgp_zclient->obuf;
|
||||||
stream_reset(s);
|
stream_reset(s);
|
||||||
|
|
||||||
zclient_create_header(
|
zclient_create_header(
|
||||||
|
@ -4512,7 +4512,7 @@ static void bgp_evpn_nh_zebra_update_send(struct bgp_evpn_nh *nh, bool add)
|
||||||
|
|
||||||
frrtrace(2, frr_bgp, evpn_mh_nh_rmac_zsend, add, nh);
|
frrtrace(2, frr_bgp, evpn_mh_nh_rmac_zsend, add, nh);
|
||||||
|
|
||||||
zclient_send_message(zclient);
|
zclient_send_message(bgp_zclient);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bgp_evpn_nh_zebra_update(struct bgp_evpn_nh *nh, bool add)
|
static void bgp_evpn_nh_zebra_update(struct bgp_evpn_nh *nh, bool add)
|
||||||
|
|
|
@ -673,8 +673,6 @@ static inline bool bgp_evpn_is_path_local(struct bgp *bgp,
|
||||||
&& pi->sub_type == BGP_ROUTE_STATIC);
|
&& pi->sub_type == BGP_ROUTE_STATIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern struct zclient *zclient;
|
|
||||||
|
|
||||||
extern void bgp_evpn_install_uninstall_default_route(struct bgp *bgp_vrf,
|
extern void bgp_evpn_install_uninstall_default_route(struct bgp *bgp_vrf,
|
||||||
afi_t afi, safi_t safi,
|
afi_t afi, safi_t safi,
|
||||||
bool add);
|
bool add);
|
||||||
|
|
|
@ -1462,22 +1462,22 @@ static int bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd,
|
||||||
output_count++;
|
output_count++;
|
||||||
|
|
||||||
if (use_json && json_array) {
|
if (use_json && json_array) {
|
||||||
const struct prefix *p =
|
const struct prefix *pfx =
|
||||||
bgp_dest_get_prefix(rm);
|
bgp_dest_get_prefix(rm);
|
||||||
|
|
||||||
json_prefix_info = json_object_new_object();
|
json_prefix_info = json_object_new_object();
|
||||||
|
|
||||||
json_object_string_addf(json_prefix_info,
|
json_object_string_addf(json_prefix_info,
|
||||||
"prefix", "%pFX", p);
|
"prefix", "%pFX", pfx);
|
||||||
|
|
||||||
json_object_int_add(json_prefix_info,
|
json_object_int_add(json_prefix_info,
|
||||||
"prefixLen", p->prefixlen);
|
"prefixLen", pfx->prefixlen);
|
||||||
|
|
||||||
json_object_object_add(json_prefix_info,
|
json_object_object_add(json_prefix_info,
|
||||||
"paths", json_array);
|
"paths", json_array);
|
||||||
json_object_object_addf(json_nroute,
|
json_object_object_addf(json_nroute,
|
||||||
json_prefix_info,
|
json_prefix_info,
|
||||||
"%pFX", p);
|
"%pFX", pfx);
|
||||||
json_array = NULL;
|
json_array = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include "bgpd/bgp_debug.h"
|
#include "bgpd/bgp_debug.h"
|
||||||
#include "bgpd/bgp_errors.h"
|
#include "bgpd/bgp_errors.h"
|
||||||
|
|
||||||
extern struct zclient *zclient;
|
extern struct zclient *bgp_zclient;
|
||||||
|
|
||||||
|
|
||||||
/* MPLS Labels hash routines. */
|
/* MPLS Labels hash routines. */
|
||||||
|
@ -157,7 +157,7 @@ int bgp_parse_fec_update(void)
|
||||||
afi_t afi;
|
afi_t afi;
|
||||||
safi_t safi;
|
safi_t safi;
|
||||||
|
|
||||||
s = zclient->ibuf;
|
s = bgp_zclient->ibuf;
|
||||||
|
|
||||||
memset(&p, 0, sizeof(p));
|
memset(&p, 0, sizeof(p));
|
||||||
p.family = stream_getw(s);
|
p.family = stream_getw(s);
|
||||||
|
@ -249,7 +249,7 @@ static void bgp_send_fec_register_label_msg(struct bgp_dest *dest, bool reg,
|
||||||
p = bgp_dest_get_prefix(dest);
|
p = bgp_dest_get_prefix(dest);
|
||||||
|
|
||||||
/* Check socket. */
|
/* Check socket. */
|
||||||
if (!zclient || zclient->sock < 0)
|
if (!bgp_zclient || bgp_zclient->sock < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (BGP_DEBUG(labelpool, LABELPOOL))
|
if (BGP_DEBUG(labelpool, LABELPOOL))
|
||||||
|
@ -258,7 +258,7 @@ static void bgp_send_fec_register_label_msg(struct bgp_dest *dest, bool reg,
|
||||||
/* If the route node has a local_label assigned or the
|
/* If the route node has a local_label assigned or the
|
||||||
* path node has an MPLS SR label index allowing zebra to
|
* path node has an MPLS SR label index allowing zebra to
|
||||||
* derive the label, proceed with registration. */
|
* derive the label, proceed with registration. */
|
||||||
s = zclient->obuf;
|
s = bgp_zclient->obuf;
|
||||||
stream_reset(s);
|
stream_reset(s);
|
||||||
command = (reg) ? ZEBRA_FEC_REGISTER : ZEBRA_FEC_UNREGISTER;
|
command = (reg) ? ZEBRA_FEC_REGISTER : ZEBRA_FEC_UNREGISTER;
|
||||||
zclient_create_header(s, command, VRF_DEFAULT);
|
zclient_create_header(s, command, VRF_DEFAULT);
|
||||||
|
@ -288,7 +288,7 @@ static void bgp_send_fec_register_label_msg(struct bgp_dest *dest, bool reg,
|
||||||
if (reg)
|
if (reg)
|
||||||
stream_putw_at(s, flags_pos, flags);
|
stream_putw_at(s, flags_pos, flags);
|
||||||
|
|
||||||
zclient_send_message(zclient);
|
zclient_send_message(bgp_zclient);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -46,7 +46,7 @@ DEFINE_MTYPE_STATIC(BGPD, MPLSVPN_NH_LABEL_BIND_CACHE,
|
||||||
/*
|
/*
|
||||||
* Definitions and external declarations.
|
* Definitions and external declarations.
|
||||||
*/
|
*/
|
||||||
extern struct zclient *zclient;
|
extern struct zclient *bgp_zclient;
|
||||||
|
|
||||||
extern int argv_find_and_parse_vpnvx(struct cmd_token **argv, int argc,
|
extern int argv_find_and_parse_vpnvx(struct cmd_token **argv, int argc,
|
||||||
int *index, afi_t *afi)
|
int *index, afi_t *afi)
|
||||||
|
@ -317,7 +317,7 @@ void vpn_leak_zebra_vrf_label_update(struct bgp *bgp, afi_t afi)
|
||||||
|
|
||||||
if (label == BGP_PREVENT_VRF_2_VRF_LEAK)
|
if (label == BGP_PREVENT_VRF_2_VRF_LEAK)
|
||||||
label = MPLS_LABEL_NONE;
|
label = MPLS_LABEL_NONE;
|
||||||
zclient_send_vrf_label(zclient, bgp->vrf_id, afi, label, ZEBRA_LSP_BGP);
|
zclient_send_vrf_label(bgp_zclient, bgp->vrf_id, afi, label, ZEBRA_LSP_BGP);
|
||||||
bgp->vpn_policy[afi].tovpn_zebra_vrf_label_last_sent = label;
|
bgp->vpn_policy[afi].tovpn_zebra_vrf_label_last_sent = label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -344,7 +344,7 @@ void vpn_leak_zebra_vrf_label_withdraw(struct bgp *bgp, afi_t afi)
|
||||||
bgp->name_pretty, bgp->vrf_id);
|
bgp->name_pretty, bgp->vrf_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
zclient_send_vrf_label(zclient, bgp->vrf_id, afi, label, ZEBRA_LSP_BGP);
|
zclient_send_vrf_label(bgp_zclient, bgp->vrf_id, afi, label, ZEBRA_LSP_BGP);
|
||||||
bgp->vpn_policy[afi].tovpn_zebra_vrf_label_last_sent = label;
|
bgp->vpn_policy[afi].tovpn_zebra_vrf_label_last_sent = label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -401,7 +401,7 @@ void vpn_leak_zebra_vrf_sid_update_per_af(struct bgp *bgp, afi_t afi)
|
||||||
ctx.table = vrf->data.l.table_id;
|
ctx.table = vrf->data.l.table_id;
|
||||||
act = afi == AFI_IP ? ZEBRA_SEG6_LOCAL_ACTION_END_DT4
|
act = afi == AFI_IP ? ZEBRA_SEG6_LOCAL_ACTION_END_DT4
|
||||||
: ZEBRA_SEG6_LOCAL_ACTION_END_DT6;
|
: ZEBRA_SEG6_LOCAL_ACTION_END_DT6;
|
||||||
zclient_send_localsid(zclient, tovpn_sid, bgp->vrf_id, act, &ctx);
|
zclient_send_localsid(bgp_zclient, tovpn_sid, bgp->vrf_id, act, &ctx);
|
||||||
|
|
||||||
tovpn_sid_ls = XCALLOC(MTYPE_BGP_SRV6_SID, sizeof(struct in6_addr));
|
tovpn_sid_ls = XCALLOC(MTYPE_BGP_SRV6_SID, sizeof(struct in6_addr));
|
||||||
*tovpn_sid_ls = *tovpn_sid;
|
*tovpn_sid_ls = *tovpn_sid;
|
||||||
|
@ -457,7 +457,7 @@ void vpn_leak_zebra_vrf_sid_update_per_vrf(struct bgp *bgp)
|
||||||
}
|
}
|
||||||
ctx.table = vrf->data.l.table_id;
|
ctx.table = vrf->data.l.table_id;
|
||||||
act = ZEBRA_SEG6_LOCAL_ACTION_END_DT46;
|
act = ZEBRA_SEG6_LOCAL_ACTION_END_DT46;
|
||||||
zclient_send_localsid(zclient, tovpn_sid, bgp->vrf_id, act, &ctx);
|
zclient_send_localsid(bgp_zclient, tovpn_sid, bgp->vrf_id, act, &ctx);
|
||||||
|
|
||||||
tovpn_sid_ls = XCALLOC(MTYPE_BGP_SRV6_SID, sizeof(struct in6_addr));
|
tovpn_sid_ls = XCALLOC(MTYPE_BGP_SRV6_SID, sizeof(struct in6_addr));
|
||||||
*tovpn_sid_ls = *tovpn_sid;
|
*tovpn_sid_ls = *tovpn_sid;
|
||||||
|
@ -519,7 +519,7 @@ void vpn_leak_zebra_vrf_sid_withdraw_per_af(struct bgp *bgp, afi_t afi)
|
||||||
bgp->vpn_policy[afi]
|
bgp->vpn_policy[afi]
|
||||||
.tovpn_sid_locator->argument_bits_length;
|
.tovpn_sid_locator->argument_bits_length;
|
||||||
}
|
}
|
||||||
zclient_send_localsid(zclient,
|
zclient_send_localsid(bgp_zclient,
|
||||||
bgp->vpn_policy[afi].tovpn_zebra_vrf_sid_last_sent,
|
bgp->vpn_policy[afi].tovpn_zebra_vrf_sid_last_sent,
|
||||||
bgp->vrf_id, ZEBRA_SEG6_LOCAL_ACTION_UNSPEC,
|
bgp->vrf_id, ZEBRA_SEG6_LOCAL_ACTION_UNSPEC,
|
||||||
&seg6localctx);
|
&seg6localctx);
|
||||||
|
@ -564,7 +564,7 @@ void vpn_leak_zebra_vrf_sid_withdraw_per_vrf(struct bgp *bgp)
|
||||||
seg6localctx.argument_len =
|
seg6localctx.argument_len =
|
||||||
bgp->tovpn_sid_locator->argument_bits_length;
|
bgp->tovpn_sid_locator->argument_bits_length;
|
||||||
}
|
}
|
||||||
zclient_send_localsid(zclient, bgp->tovpn_zebra_vrf_sid_last_sent,
|
zclient_send_localsid(bgp_zclient, bgp->tovpn_zebra_vrf_sid_last_sent,
|
||||||
bgp->vrf_id, ZEBRA_SEG6_LOCAL_ACTION_UNSPEC,
|
bgp->vrf_id, ZEBRA_SEG6_LOCAL_ACTION_UNSPEC,
|
||||||
&seg6localctx);
|
&seg6localctx);
|
||||||
XFREE(MTYPE_BGP_SRV6_SID, bgp->tovpn_zebra_vrf_sid_last_sent);
|
XFREE(MTYPE_BGP_SRV6_SID, bgp->tovpn_zebra_vrf_sid_last_sent);
|
||||||
|
|
|
@ -1460,8 +1460,6 @@ static struct bgp_path_info *bgpL3vpnRte_lookup(struct variable *v, oid name[],
|
||||||
pi = bgp_lookup_route_next(l3vpn_bgp, dest, &prefix, policy,
|
pi = bgp_lookup_route_next(l3vpn_bgp, dest, &prefix, policy,
|
||||||
&nexthop);
|
&nexthop);
|
||||||
if (pi) {
|
if (pi) {
|
||||||
uint8_t vrf_name_len =
|
|
||||||
strnlen((*l3vpn_bgp)->name, VRF_NAMSIZ);
|
|
||||||
const struct prefix *p = bgp_dest_get_prefix(*dest);
|
const struct prefix *p = bgp_dest_get_prefix(*dest);
|
||||||
uint8_t oid_index;
|
uint8_t oid_index;
|
||||||
bool v4 = (p->family == AF_INET);
|
bool v4 = (p->family == AF_INET);
|
||||||
|
@ -1469,6 +1467,8 @@ static struct bgp_path_info *bgpL3vpnRte_lookup(struct variable *v, oid name[],
|
||||||
: sizeof(struct in6_addr);
|
: sizeof(struct in6_addr);
|
||||||
struct attr *attr = pi->attr;
|
struct attr *attr = pi->attr;
|
||||||
|
|
||||||
|
vrf_name_len = strnlen((*l3vpn_bgp)->name, VRF_NAMSIZ);
|
||||||
|
|
||||||
/* copy the index parameters */
|
/* copy the index parameters */
|
||||||
oid_copy_str(&name[namelen], (*l3vpn_bgp)->name,
|
oid_copy_str(&name[namelen], (*l3vpn_bgp)->name,
|
||||||
vrf_name_len);
|
vrf_name_len);
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#include "bgpd/bgp_mplsvpn.h"
|
#include "bgpd/bgp_mplsvpn.h"
|
||||||
#include "bgpd/bgp_ecommunity.h"
|
#include "bgpd/bgp_ecommunity.h"
|
||||||
|
|
||||||
extern struct zclient *zclient;
|
extern struct zclient *bgp_zclient;
|
||||||
|
|
||||||
static void register_zebra_rnh(struct bgp_nexthop_cache *bnc);
|
static void register_zebra_rnh(struct bgp_nexthop_cache *bnc);
|
||||||
static void unregister_zebra_rnh(struct bgp_nexthop_cache *bnc);
|
static void unregister_zebra_rnh(struct bgp_nexthop_cache *bnc);
|
||||||
|
@ -667,7 +667,7 @@ static void bgp_process_nexthop_update(struct bgp_nexthop_cache *bnc,
|
||||||
nexthop->vrf_id);
|
nexthop->vrf_id);
|
||||||
if (ifp)
|
if (ifp)
|
||||||
zclient_send_interface_radv_req(
|
zclient_send_interface_radv_req(
|
||||||
zclient, nexthop->vrf_id, ifp,
|
bgp_zclient, nexthop->vrf_id, ifp,
|
||||||
true,
|
true,
|
||||||
BGP_UNNUM_DEFAULT_RA_INTERVAL);
|
BGP_UNNUM_DEFAULT_RA_INTERVAL);
|
||||||
}
|
}
|
||||||
|
@ -1131,11 +1131,11 @@ static bool make_prefix(int afi, struct bgp_path_info *pi, struct prefix *p,
|
||||||
*/
|
*/
|
||||||
static void sendmsg_zebra_rnh(struct bgp_nexthop_cache *bnc, int command)
|
static void sendmsg_zebra_rnh(struct bgp_nexthop_cache *bnc, int command)
|
||||||
{
|
{
|
||||||
bool exact_match = false;
|
bool match_p = false;
|
||||||
bool resolve_via_default = false;
|
bool resolve_via_default = false;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!zclient)
|
if (!bgp_zclient)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Don't try to register if Zebra doesn't know of this instance. */
|
/* Don't try to register if Zebra doesn't know of this instance. */
|
||||||
|
@ -1155,7 +1155,7 @@ static void sendmsg_zebra_rnh(struct bgp_nexthop_cache *bnc, int command)
|
||||||
}
|
}
|
||||||
if (command == ZEBRA_NEXTHOP_REGISTER) {
|
if (command == ZEBRA_NEXTHOP_REGISTER) {
|
||||||
if (CHECK_FLAG(bnc->flags, BGP_NEXTHOP_CONNECTED))
|
if (CHECK_FLAG(bnc->flags, BGP_NEXTHOP_CONNECTED))
|
||||||
exact_match = true;
|
match_p = true;
|
||||||
if (CHECK_FLAG(bnc->flags, BGP_STATIC_ROUTE_EXACT_MATCH))
|
if (CHECK_FLAG(bnc->flags, BGP_STATIC_ROUTE_EXACT_MATCH))
|
||||||
resolve_via_default = true;
|
resolve_via_default = true;
|
||||||
}
|
}
|
||||||
|
@ -1165,8 +1165,8 @@ 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, SAFI_UNICAST,
|
ret = zclient_send_rnh(bgp_zclient, command, &bnc->prefix, SAFI_UNICAST,
|
||||||
exact_match, resolve_via_default,
|
match_p, resolve_via_default,
|
||||||
bnc->bgp->vrf_id);
|
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,
|
||||||
|
@ -1593,7 +1593,7 @@ void bgp_nht_reg_enhe_cap_intfs(struct peer *peer)
|
||||||
if (!ifp)
|
if (!ifp)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
zclient_send_interface_radv_req(zclient,
|
zclient_send_interface_radv_req(bgp_zclient,
|
||||||
nhop->vrf_id,
|
nhop->vrf_id,
|
||||||
ifp, true,
|
ifp, true,
|
||||||
BGP_UNNUM_DEFAULT_RA_INTERVAL);
|
BGP_UNNUM_DEFAULT_RA_INTERVAL);
|
||||||
|
@ -1643,7 +1643,7 @@ void bgp_nht_dereg_enhe_cap_intfs(struct peer *peer)
|
||||||
if (!ifp)
|
if (!ifp)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
zclient_send_interface_radv_req(zclient, nhop->vrf_id, ifp, 0,
|
zclient_send_interface_radv_req(bgp_zclient, nhop->vrf_id, ifp, 0,
|
||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3148,8 +3148,6 @@ static void bgp_dynamic_capability_paths_limit(uint8_t *pnt, int action,
|
||||||
SET_FLAG(peer->cap, PEER_CAP_PATHS_LIMIT_RCV);
|
SET_FLAG(peer->cap, PEER_CAP_PATHS_LIMIT_RCV);
|
||||||
|
|
||||||
while (data + CAPABILITY_CODE_PATHS_LIMIT_LEN <= end) {
|
while (data + CAPABILITY_CODE_PATHS_LIMIT_LEN <= end) {
|
||||||
afi_t afi;
|
|
||||||
safi_t safi;
|
|
||||||
iana_afi_t pkt_afi;
|
iana_afi_t pkt_afi;
|
||||||
iana_safi_t pkt_safi;
|
iana_safi_t pkt_safi;
|
||||||
uint16_t paths_limit = 0;
|
uint16_t paths_limit = 0;
|
||||||
|
@ -3508,8 +3506,6 @@ static void bgp_dynamic_capability_llgr(uint8_t *pnt, int action,
|
||||||
SET_FLAG(peer->cap, PEER_CAP_LLGR_RCV);
|
SET_FLAG(peer->cap, PEER_CAP_LLGR_RCV);
|
||||||
|
|
||||||
while (data + BGP_CAP_LLGR_MIN_PACKET_LEN <= end) {
|
while (data + BGP_CAP_LLGR_MIN_PACKET_LEN <= end) {
|
||||||
afi_t afi;
|
|
||||||
safi_t safi;
|
|
||||||
iana_afi_t pkt_afi;
|
iana_afi_t pkt_afi;
|
||||||
iana_safi_t pkt_safi;
|
iana_safi_t pkt_safi;
|
||||||
struct graceful_restart_af graf;
|
struct graceful_restart_af graf;
|
||||||
|
@ -3616,8 +3612,6 @@ static void bgp_dynamic_capability_graceful_restart(uint8_t *pnt, int action,
|
||||||
|
|
||||||
while (data + GRACEFUL_RESTART_CAPABILITY_PER_AFI_SAFI_SIZE <=
|
while (data + GRACEFUL_RESTART_CAPABILITY_PER_AFI_SAFI_SIZE <=
|
||||||
end) {
|
end) {
|
||||||
afi_t afi;
|
|
||||||
safi_t safi;
|
|
||||||
iana_afi_t pkt_afi;
|
iana_afi_t pkt_afi;
|
||||||
iana_safi_t pkt_safi;
|
iana_safi_t pkt_safi;
|
||||||
struct graceful_restart_af graf;
|
struct graceful_restart_af graf;
|
||||||
|
|
|
@ -442,7 +442,7 @@ static bool bgp_pbr_extract(struct bgp_pbr_match_val list[],
|
||||||
struct bgp_pbr_range_port *range)
|
struct bgp_pbr_range_port *range)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
bool exact_match = false;
|
bool match_p = false;
|
||||||
|
|
||||||
if (range)
|
if (range)
|
||||||
memset(range, 0, sizeof(struct bgp_pbr_range_port));
|
memset(range, 0, sizeof(struct bgp_pbr_range_port));
|
||||||
|
@ -457,9 +457,9 @@ static bool bgp_pbr_extract(struct bgp_pbr_match_val list[],
|
||||||
OPERATOR_COMPARE_EQUAL_TO)) {
|
OPERATOR_COMPARE_EQUAL_TO)) {
|
||||||
if (range)
|
if (range)
|
||||||
range->min_port = list[i].value;
|
range->min_port = list[i].value;
|
||||||
exact_match = true;
|
match_p = true;
|
||||||
}
|
}
|
||||||
if (exact_match && i > 0)
|
if (match_p && i > 0)
|
||||||
return false;
|
return false;
|
||||||
if (list[i].compare_operator ==
|
if (list[i].compare_operator ==
|
||||||
(OPERATOR_COMPARE_GREATER_THAN +
|
(OPERATOR_COMPARE_GREATER_THAN +
|
||||||
|
|
|
@ -151,8 +151,6 @@ struct bgp_pbr_config {
|
||||||
bool pbr_interface_any_ipv6;
|
bool pbr_interface_any_ipv6;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct bgp_pbr_config *bgp_pbr_cfg;
|
|
||||||
|
|
||||||
struct bgp_pbr_rule {
|
struct bgp_pbr_rule {
|
||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
struct prefix src;
|
struct prefix src;
|
||||||
|
|
|
@ -12034,8 +12034,6 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct bgp_dest *bn,
|
||||||
/* Line 7 display Originator, Cluster-id */
|
/* Line 7 display Originator, Cluster-id */
|
||||||
if (CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_ORIGINATOR_ID)) ||
|
if (CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_ORIGINATOR_ID)) ||
|
||||||
CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_CLUSTER_LIST))) {
|
CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_CLUSTER_LIST))) {
|
||||||
char buf[BUFSIZ] = {0};
|
|
||||||
|
|
||||||
if (CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_ORIGINATOR_ID))) {
|
if (CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_ORIGINATOR_ID))) {
|
||||||
if (json_paths)
|
if (json_paths)
|
||||||
json_object_string_addf(json_path,
|
json_object_string_addf(json_path,
|
||||||
|
@ -12047,9 +12045,7 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct bgp_dest *bn,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_CLUSTER_LIST))) {
|
if (CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_CLUSTER_LIST))) {
|
||||||
struct cluster_list *cluster =
|
struct cluster_list *cluster = bgp_attr_get_cluster(attr);
|
||||||
bgp_attr_get_cluster(attr);
|
|
||||||
int i;
|
|
||||||
|
|
||||||
if (json_paths) {
|
if (json_paths) {
|
||||||
json_cluster_list = json_object_new_object();
|
json_cluster_list = json_object_new_object();
|
||||||
|
@ -13579,7 +13575,7 @@ DEFUN (show_ip_bgp_large_community_list,
|
||||||
afi_t afi = AFI_IP6;
|
afi_t afi = AFI_IP6;
|
||||||
safi_t safi = SAFI_UNICAST;
|
safi_t safi = SAFI_UNICAST;
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
bool exact_match = 0;
|
bool match_p = 0;
|
||||||
struct bgp *bgp = NULL;
|
struct bgp *bgp = NULL;
|
||||||
bool uj = use_json(argc, argv);
|
bool uj = use_json(argc, argv);
|
||||||
|
|
||||||
|
@ -13596,10 +13592,10 @@ DEFUN (show_ip_bgp_large_community_list,
|
||||||
const char *clist_number_or_name = argv[++idx]->arg;
|
const char *clist_number_or_name = argv[++idx]->arg;
|
||||||
|
|
||||||
if (++idx < argc && strmatch(argv[idx]->text, "exact-match"))
|
if (++idx < argc && strmatch(argv[idx]->text, "exact-match"))
|
||||||
exact_match = 1;
|
match_p = 1;
|
||||||
|
|
||||||
return bgp_show_lcommunity_list(vty, bgp, clist_number_or_name,
|
return bgp_show_lcommunity_list(vty, bgp, clist_number_or_name,
|
||||||
exact_match, afi, safi, uj);
|
match_p, afi, safi, uj);
|
||||||
}
|
}
|
||||||
DEFUN (show_ip_bgp_large_community,
|
DEFUN (show_ip_bgp_large_community,
|
||||||
show_ip_bgp_large_community_cmd,
|
show_ip_bgp_large_community_cmd,
|
||||||
|
@ -13618,7 +13614,7 @@ DEFUN (show_ip_bgp_large_community,
|
||||||
afi_t afi = AFI_IP6;
|
afi_t afi = AFI_IP6;
|
||||||
safi_t safi = SAFI_UNICAST;
|
safi_t safi = SAFI_UNICAST;
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
bool exact_match = 0;
|
bool match_p = false;
|
||||||
struct bgp *bgp = NULL;
|
struct bgp *bgp = NULL;
|
||||||
bool uj = use_json(argc, argv);
|
bool uj = use_json(argc, argv);
|
||||||
uint16_t show_flags = 0;
|
uint16_t show_flags = 0;
|
||||||
|
@ -13636,10 +13632,10 @@ DEFUN (show_ip_bgp_large_community,
|
||||||
if (argv_find(argv, argc, "AA:BB:CC", &idx)) {
|
if (argv_find(argv, argc, "AA:BB:CC", &idx)) {
|
||||||
if (argv_find(argv, argc, "exact-match", &idx)) {
|
if (argv_find(argv, argc, "exact-match", &idx)) {
|
||||||
argc--;
|
argc--;
|
||||||
exact_match = 1;
|
match_p = true;
|
||||||
}
|
}
|
||||||
return bgp_show_lcommunity(vty, bgp, argc, argv,
|
return bgp_show_lcommunity(vty, bgp, argc, argv,
|
||||||
exact_match, afi, safi, uj);
|
match_p, afi, safi, uj);
|
||||||
} else
|
} else
|
||||||
return bgp_show(vty, bgp, afi, safi,
|
return bgp_show(vty, bgp, afi, safi,
|
||||||
bgp_show_type_lcommunity_all, NULL, show_flags,
|
bgp_show_type_lcommunity_all, NULL, show_flags,
|
||||||
|
@ -13910,7 +13906,7 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
|
||||||
void *output_arg = NULL;
|
void *output_arg = NULL;
|
||||||
struct bgp *bgp = NULL;
|
struct bgp *bgp = NULL;
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
int exact_match = 0;
|
int match_p = 0;
|
||||||
char *community = NULL;
|
char *community = NULL;
|
||||||
bool first = true;
|
bool first = true;
|
||||||
uint16_t show_flags = 0;
|
uint16_t show_flags = 0;
|
||||||
|
@ -13975,7 +13971,7 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
|
||||||
community = maybecomm;
|
community = maybecomm;
|
||||||
|
|
||||||
if (argv_find(argv, argc, "exact-match", &idx))
|
if (argv_find(argv, argc, "exact-match", &idx))
|
||||||
exact_match = 1;
|
match_p = 1;
|
||||||
|
|
||||||
if (!community)
|
if (!community)
|
||||||
sh_type = bgp_show_type_community_all;
|
sh_type = bgp_show_type_community_all;
|
||||||
|
@ -13986,7 +13982,7 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
|
||||||
struct community_list *list;
|
struct community_list *list;
|
||||||
|
|
||||||
if (argv_find(argv, argc, "exact-match", &idx))
|
if (argv_find(argv, argc, "exact-match", &idx))
|
||||||
exact_match = 1;
|
match_p = 1;
|
||||||
|
|
||||||
list = community_list_lookup(bgp_clist, clist_number_or_name, 0,
|
list = community_list_lookup(bgp_clist, clist_number_or_name, 0,
|
||||||
COMMUNITY_LIST_MASTER);
|
COMMUNITY_LIST_MASTER);
|
||||||
|
@ -13996,7 +13992,7 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
|
||||||
return CMD_WARNING;
|
return CMD_WARNING;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exact_match)
|
if (match_p)
|
||||||
sh_type = bgp_show_type_community_list_exact;
|
sh_type = bgp_show_type_community_list_exact;
|
||||||
else
|
else
|
||||||
sh_type = bgp_show_type_community_list;
|
sh_type = bgp_show_type_community_list;
|
||||||
|
@ -14106,7 +14102,7 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
|
||||||
/* show bgp: AFI_IP6, show ip bgp: AFI_IP */
|
/* show bgp: AFI_IP6, show ip bgp: AFI_IP */
|
||||||
if (community)
|
if (community)
|
||||||
return bgp_show_community(vty, bgp, community,
|
return bgp_show_community(vty, bgp, community,
|
||||||
exact_match, afi, safi,
|
match_p, afi, safi,
|
||||||
show_flags);
|
show_flags);
|
||||||
else
|
else
|
||||||
return bgp_show(vty, bgp, afi, safi, sh_type,
|
return bgp_show(vty, bgp, afi, safi, sh_type,
|
||||||
|
@ -14151,7 +14147,7 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
|
||||||
if (community)
|
if (community)
|
||||||
bgp_show_community(
|
bgp_show_community(
|
||||||
vty, abgp, community,
|
vty, abgp, community,
|
||||||
exact_match, afi, safi,
|
match_p, afi, safi,
|
||||||
show_flags);
|
show_flags);
|
||||||
else
|
else
|
||||||
bgp_show(vty, abgp, afi, safi,
|
bgp_show(vty, abgp, afi, safi,
|
||||||
|
@ -14199,7 +14195,7 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
|
||||||
if (community)
|
if (community)
|
||||||
bgp_show_community(
|
bgp_show_community(
|
||||||
vty, abgp, community,
|
vty, abgp, community,
|
||||||
exact_match, afi, safi,
|
match_p, afi, safi,
|
||||||
show_flags);
|
show_flags);
|
||||||
else
|
else
|
||||||
bgp_show(vty, abgp, afi, safi,
|
bgp_show(vty, abgp, afi, safi,
|
||||||
|
@ -15469,15 +15465,15 @@ show_adj_route(struct vty *vty, struct peer *peer, struct bgp_table *table,
|
||||||
json_net =
|
json_net =
|
||||||
json_object_new_object();
|
json_object_new_object();
|
||||||
|
|
||||||
struct bgp_path_info bpi;
|
struct bgp_path_info pathi;
|
||||||
struct bgp_dest buildit = *dest;
|
struct bgp_dest buildit = *dest;
|
||||||
struct bgp_dest *pass_in;
|
struct bgp_dest *pass_in;
|
||||||
|
|
||||||
if (route_filtered ||
|
if (route_filtered ||
|
||||||
ret == RMAP_DENY) {
|
ret == RMAP_DENY) {
|
||||||
bpi.attr = &attr;
|
pathi.attr = &attr;
|
||||||
bpi.peer = peer;
|
pathi.peer = peer;
|
||||||
buildit.info = &bpi;
|
buildit.info = &pathi;
|
||||||
|
|
||||||
pass_in = &buildit;
|
pass_in = &buildit;
|
||||||
} else
|
} else
|
||||||
|
|
|
@ -1355,7 +1355,7 @@ lib_route_map_entry_match_condition_rmap_match_condition_comm_list_finish(
|
||||||
{
|
{
|
||||||
struct routemap_hook_context *rhc;
|
struct routemap_hook_context *rhc;
|
||||||
const char *value;
|
const char *value;
|
||||||
bool exact_match = false;
|
bool match_p = false;
|
||||||
bool any = false;
|
bool any = false;
|
||||||
char *argstr;
|
char *argstr;
|
||||||
const char *condition;
|
const char *condition;
|
||||||
|
@ -1367,13 +1367,13 @@ lib_route_map_entry_match_condition_rmap_match_condition_comm_list_finish(
|
||||||
value = yang_dnode_get_string(args->dnode, "comm-list-name");
|
value = yang_dnode_get_string(args->dnode, "comm-list-name");
|
||||||
|
|
||||||
if (yang_dnode_exists(args->dnode, "comm-list-name-exact-match"))
|
if (yang_dnode_exists(args->dnode, "comm-list-name-exact-match"))
|
||||||
exact_match = yang_dnode_get_bool(
|
match_p = yang_dnode_get_bool(
|
||||||
args->dnode, "./comm-list-name-exact-match");
|
args->dnode, "./comm-list-name-exact-match");
|
||||||
|
|
||||||
if (yang_dnode_exists(args->dnode, "comm-list-name-any"))
|
if (yang_dnode_exists(args->dnode, "comm-list-name-any"))
|
||||||
any = yang_dnode_get_bool(args->dnode, "comm-list-name-any");
|
any = yang_dnode_get_bool(args->dnode, "comm-list-name-any");
|
||||||
|
|
||||||
if (exact_match) {
|
if (match_p) {
|
||||||
argstr = XMALLOC(MTYPE_ROUTE_MAP_COMPILED,
|
argstr = XMALLOC(MTYPE_ROUTE_MAP_COMPILED,
|
||||||
strlen(value) + strlen("exact-match") + 2);
|
strlen(value) + strlen("exact-match") + 2);
|
||||||
|
|
||||||
|
|
|
@ -967,10 +967,10 @@ static int update_group_show_walkcb(struct update_group *updgrp, void *arg)
|
||||||
if (ctx->uj) {
|
if (ctx->uj) {
|
||||||
json_peers = json_object_new_array();
|
json_peers = json_object_new_array();
|
||||||
SUBGRP_FOREACH_PEER (subgrp, paf) {
|
SUBGRP_FOREACH_PEER (subgrp, paf) {
|
||||||
json_object *peer =
|
json_object *jpeer =
|
||||||
json_object_new_string(
|
json_object_new_string(
|
||||||
paf->peer->host);
|
paf->peer->host);
|
||||||
json_object_array_add(json_peers, peer);
|
json_object_array_add(json_peers, jpeer);
|
||||||
}
|
}
|
||||||
json_object_object_add(json_subgrp, "peers",
|
json_object_object_add(json_subgrp, "peers",
|
||||||
json_peers);
|
json_peers);
|
||||||
|
|
|
@ -11504,7 +11504,7 @@ DEFPY (show_bgp_vrfs,
|
||||||
json_vrfs = json_object_new_object();
|
json_vrfs = json_object_new_object();
|
||||||
|
|
||||||
for (ALL_LIST_ELEMENTS_RO(inst, node, bgp)) {
|
for (ALL_LIST_ELEMENTS_RO(inst, node, bgp)) {
|
||||||
const char *name;
|
const char *bname;
|
||||||
|
|
||||||
/* Skip Views. */
|
/* Skip Views. */
|
||||||
if (bgp->inst_type == BGP_INSTANCE_TYPE_VIEW)
|
if (bgp->inst_type == BGP_INSTANCE_TYPE_VIEW)
|
||||||
|
@ -11523,18 +11523,18 @@ DEFPY (show_bgp_vrfs,
|
||||||
json_vrf = json_object_new_object();
|
json_vrf = json_object_new_object();
|
||||||
|
|
||||||
if (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) {
|
if (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) {
|
||||||
name = VRF_DEFAULT_NAME;
|
bname = VRF_DEFAULT_NAME;
|
||||||
type = "DFLT";
|
type = "DFLT";
|
||||||
} else {
|
} else {
|
||||||
name = bgp->name;
|
bname = bgp->name;
|
||||||
type = "VRF";
|
type = "VRF";
|
||||||
}
|
}
|
||||||
|
|
||||||
show_bgp_vrfs_detail_common(vty, bgp, json_vrf, name, type,
|
show_bgp_vrfs_detail_common(vty, bgp, json_vrf, bname, type,
|
||||||
false);
|
false);
|
||||||
|
|
||||||
if (uj)
|
if (uj)
|
||||||
json_object_object_add(json_vrfs, name, json_vrf);
|
json_object_object_add(json_vrfs, bname, json_vrf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uj) {
|
if (uj) {
|
||||||
|
|
232
bgpd/bgp_zebra.c
232
bgpd/bgp_zebra.c
|
@ -56,8 +56,8 @@
|
||||||
#include "bgpd/bgp_lcommunity.h"
|
#include "bgpd/bgp_lcommunity.h"
|
||||||
|
|
||||||
/* All information about zebra. */
|
/* All information about zebra. */
|
||||||
struct zclient *zclient = NULL;
|
struct zclient *bgp_zclient = NULL;
|
||||||
struct zclient *zclient_sync;
|
struct zclient *bgp_zclient_sync;
|
||||||
static bool bgp_zebra_label_manager_connect(void);
|
static bool bgp_zebra_label_manager_connect(void);
|
||||||
|
|
||||||
/* hook to indicate vrf status change for SNMP */
|
/* hook to indicate vrf status change for SNMP */
|
||||||
|
@ -69,7 +69,7 @@ DEFINE_MTYPE_STATIC(BGPD, BGP_IF_INFO, "BGP interface context");
|
||||||
/* Can we install into zebra? */
|
/* Can we install into zebra? */
|
||||||
static inline bool bgp_install_info_to_zebra(struct bgp *bgp)
|
static inline bool bgp_install_info_to_zebra(struct bgp *bgp)
|
||||||
{
|
{
|
||||||
if (zclient->sock <= 0)
|
if (bgp_zclient->sock <= 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
|
if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) {
|
||||||
|
@ -1010,15 +1010,15 @@ struct bgp *bgp_tm_bgp;
|
||||||
|
|
||||||
static void bgp_zebra_tm_connect(struct event *t)
|
static void bgp_zebra_tm_connect(struct event *t)
|
||||||
{
|
{
|
||||||
struct zclient *zclient;
|
struct zclient *zc;
|
||||||
int delay = 10, ret = 0;
|
int delay = 10, ret = 0;
|
||||||
|
|
||||||
zclient = EVENT_ARG(t);
|
zc = EVENT_ARG(t);
|
||||||
if (bgp_tm_status_connected && zclient->sock > 0)
|
if (bgp_tm_status_connected && zc->sock > 0)
|
||||||
delay = 60;
|
delay = 60;
|
||||||
else {
|
else {
|
||||||
bgp_tm_status_connected = false;
|
bgp_tm_status_connected = false;
|
||||||
ret = tm_table_manager_connect(zclient);
|
ret = tm_table_manager_connect(zc);
|
||||||
}
|
}
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
zlog_err("Error connecting to table manager!");
|
zlog_err("Error connecting to table manager!");
|
||||||
|
@ -1031,7 +1031,7 @@ static void bgp_zebra_tm_connect(struct event *t)
|
||||||
}
|
}
|
||||||
bgp_tm_status_connected = true;
|
bgp_tm_status_connected = true;
|
||||||
if (!bgp_tm_chunk_obtained) {
|
if (!bgp_tm_chunk_obtained) {
|
||||||
if (bgp_zebra_get_table_range(zclient, bgp_tm_chunk_size,
|
if (bgp_zebra_get_table_range(zc, bgp_tm_chunk_size,
|
||||||
&bgp_tm_min,
|
&bgp_tm_min,
|
||||||
&bgp_tm_max) >= 0) {
|
&bgp_tm_max) >= 0) {
|
||||||
bgp_tm_chunk_obtained = true;
|
bgp_tm_chunk_obtained = true;
|
||||||
|
@ -1040,7 +1040,7 @@ static void bgp_zebra_tm_connect(struct event *t)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
event_add_timer(bm->master, bgp_zebra_tm_connect, zclient, delay,
|
event_add_timer(bm->master, bgp_zebra_tm_connect, zc, delay,
|
||||||
&bgp_tm_thread_connect);
|
&bgp_tm_thread_connect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1071,7 +1071,7 @@ void bgp_zebra_init_tm_connect(struct bgp *bgp)
|
||||||
bgp_tm_min = bgp_tm_max = 0;
|
bgp_tm_min = bgp_tm_max = 0;
|
||||||
bgp_tm_chunk_size = BGP_FLOWSPEC_TABLE_CHUNK;
|
bgp_tm_chunk_size = BGP_FLOWSPEC_TABLE_CHUNK;
|
||||||
bgp_tm_bgp = bgp;
|
bgp_tm_bgp = bgp;
|
||||||
event_add_timer(bm->master, bgp_zebra_tm_connect, zclient_sync, delay,
|
event_add_timer(bm->master, bgp_zebra_tm_connect, bgp_zclient_sync, delay,
|
||||||
&bgp_tm_thread_connect);
|
&bgp_tm_thread_connect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1650,7 +1650,7 @@ bgp_zebra_announce_actual(struct bgp_dest *dest, struct bgp_path_info *info,
|
||||||
__func__, p, (allow_recursion ? "" : "NOT "));
|
__func__, p, (allow_recursion ? "" : "NOT "));
|
||||||
}
|
}
|
||||||
|
|
||||||
return zclient_route_send(ZEBRA_ROUTE_ADD, zclient, &api);
|
return zclient_route_send(ZEBRA_ROUTE_ADD, bgp_zclient, &api);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1747,7 +1747,7 @@ enum zclient_send_status bgp_zebra_withdraw_actual(struct bgp_dest *dest,
|
||||||
zlog_debug("Tx route delete %s (table id %u) %pFX",
|
zlog_debug("Tx route delete %s (table id %u) %pFX",
|
||||||
bgp->name_pretty, api.tableid, &api.prefix);
|
bgp->name_pretty, api.tableid, &api.prefix);
|
||||||
|
|
||||||
return zclient_route_send(ZEBRA_ROUTE_DELETE, zclient, &api);
|
return zclient_route_send(ZEBRA_ROUTE_DELETE, bgp_zclient, &api);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2071,19 +2071,19 @@ int bgp_redistribute_set(struct bgp *bgp, afi_t afi, int type,
|
||||||
.table_id = instance,
|
.table_id = instance,
|
||||||
.vrf_id = bgp->vrf_id,
|
.vrf_id = bgp->vrf_id,
|
||||||
};
|
};
|
||||||
if (redist_lookup_table_direct(&zclient->mi_redist[afi][type], &table) !=
|
if (redist_lookup_table_direct(&bgp_zclient->mi_redist[afi][type],
|
||||||
NULL)
|
&table) != NULL)
|
||||||
return CMD_WARNING;
|
return CMD_WARNING;
|
||||||
|
|
||||||
redist_add_table_direct(&zclient->mi_redist[afi][type], &table);
|
redist_add_table_direct(&bgp_zclient->mi_redist[afi][type], &table);
|
||||||
} else {
|
} else {
|
||||||
if (redist_check_instance(&zclient->mi_redist[afi][type], instance))
|
if (redist_check_instance(&bgp_zclient->mi_redist[afi][type], instance))
|
||||||
return CMD_WARNING;
|
return CMD_WARNING;
|
||||||
|
|
||||||
redist_add_instance(&zclient->mi_redist[afi][type], instance);
|
redist_add_instance(&bgp_zclient->mi_redist[afi][type], instance);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (vrf_bitmap_check(&zclient->redist[afi][type], bgp->vrf_id))
|
if (vrf_bitmap_check(&bgp_zclient->redist[afi][type], bgp->vrf_id))
|
||||||
return CMD_WARNING;
|
return CMD_WARNING;
|
||||||
|
|
||||||
#ifdef ENABLE_BGP_VNC
|
#ifdef ENABLE_BGP_VNC
|
||||||
|
@ -2093,7 +2093,7 @@ int bgp_redistribute_set(struct bgp *bgp, afi_t afi, int type,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
vrf_bitmap_set(&zclient->redist[afi][type], bgp->vrf_id);
|
vrf_bitmap_set(&bgp_zclient->redist[afi][type], bgp->vrf_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2111,7 +2111,7 @@ int bgp_redistribute_set(struct bgp *bgp, afi_t afi, int type,
|
||||||
instance);
|
instance);
|
||||||
|
|
||||||
/* Send distribute add message to zebra. */
|
/* Send distribute add message to zebra. */
|
||||||
zebra_redistribute_send(ZEBRA_REDISTRIBUTE_ADD, zclient, afi, type,
|
zebra_redistribute_send(ZEBRA_REDISTRIBUTE_ADD, bgp_zclient, afi, type,
|
||||||
instance, bgp->vrf_id);
|
instance, bgp->vrf_id);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
|
@ -2132,9 +2132,9 @@ int bgp_redistribute_resend(struct bgp *bgp, afi_t afi, int type,
|
||||||
instance);
|
instance);
|
||||||
|
|
||||||
/* Send distribute add message to zebra. */
|
/* Send distribute add message to zebra. */
|
||||||
zebra_redistribute_send(ZEBRA_REDISTRIBUTE_DELETE, zclient, afi, type,
|
zebra_redistribute_send(ZEBRA_REDISTRIBUTE_DELETE, bgp_zclient, afi, type,
|
||||||
instance, bgp->vrf_id);
|
instance, bgp->vrf_id);
|
||||||
zebra_redistribute_send(ZEBRA_REDISTRIBUTE_ADD, zclient, afi, type,
|
zebra_redistribute_send(ZEBRA_REDISTRIBUTE_ADD, bgp_zclient, afi, type,
|
||||||
instance, bgp->vrf_id);
|
instance, bgp->vrf_id);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2214,21 +2214,21 @@ int bgp_redistribute_unreg(struct bgp *bgp, afi_t afi, int type,
|
||||||
.table_id = instance,
|
.table_id = instance,
|
||||||
.vrf_id = bgp->vrf_id,
|
.vrf_id = bgp->vrf_id,
|
||||||
};
|
};
|
||||||
if (redist_lookup_table_direct(&zclient->mi_redist[afi][type], &table) ==
|
if (redist_lookup_table_direct(&bgp_zclient->mi_redist[afi][type], &table) ==
|
||||||
NULL)
|
NULL)
|
||||||
return CMD_WARNING;
|
return CMD_WARNING;
|
||||||
|
|
||||||
redist_del_table_direct(&zclient->mi_redist[afi][type], &table);
|
redist_del_table_direct(&bgp_zclient->mi_redist[afi][type], &table);
|
||||||
} else {
|
} else {
|
||||||
if (!redist_check_instance(&zclient->mi_redist[afi][type], instance))
|
if (!redist_check_instance(&bgp_zclient->mi_redist[afi][type], instance))
|
||||||
return CMD_WARNING;
|
return CMD_WARNING;
|
||||||
|
|
||||||
redist_del_instance(&zclient->mi_redist[afi][type], instance);
|
redist_del_instance(&bgp_zclient->mi_redist[afi][type], instance);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!vrf_bitmap_check(&zclient->redist[afi][type], bgp->vrf_id))
|
if (!vrf_bitmap_check(&bgp_zclient->redist[afi][type], bgp->vrf_id))
|
||||||
return CMD_WARNING;
|
return CMD_WARNING;
|
||||||
vrf_bitmap_unset(&zclient->redist[afi][type], bgp->vrf_id);
|
vrf_bitmap_unset(&bgp_zclient->redist[afi][type], bgp->vrf_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bgp_install_info_to_zebra(bgp)) {
|
if (bgp_install_info_to_zebra(bgp)) {
|
||||||
|
@ -2237,7 +2237,7 @@ int bgp_redistribute_unreg(struct bgp *bgp, afi_t afi, int type,
|
||||||
zlog_debug("Tx redistribute del %s afi %d %s %d",
|
zlog_debug("Tx redistribute del %s afi %d %s %d",
|
||||||
bgp->name_pretty, afi,
|
bgp->name_pretty, afi,
|
||||||
zebra_route_string(type), instance);
|
zebra_route_string(type), instance);
|
||||||
zebra_redistribute_send(ZEBRA_REDISTRIBUTE_DELETE, zclient, afi,
|
zebra_redistribute_send(ZEBRA_REDISTRIBUTE_DELETE, bgp_zclient, afi,
|
||||||
type, instance, bgp->vrf_id);
|
type, instance, bgp->vrf_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2325,7 +2325,7 @@ void bgp_redistribute_redo(struct bgp *bgp)
|
||||||
|
|
||||||
void bgp_zclient_reset(void)
|
void bgp_zclient_reset(void)
|
||||||
{
|
{
|
||||||
zclient_reset(zclient);
|
zclient_reset(bgp_zclient);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Register this instance with Zebra. Invoked upon connect (for
|
/* Register this instance with Zebra. Invoked upon connect (for
|
||||||
|
@ -2335,14 +2335,14 @@ void bgp_zclient_reset(void)
|
||||||
void bgp_zebra_instance_register(struct bgp *bgp)
|
void bgp_zebra_instance_register(struct bgp *bgp)
|
||||||
{
|
{
|
||||||
/* Don't try to register if we're not connected to Zebra */
|
/* Don't try to register if we're not connected to Zebra */
|
||||||
if (!zclient || zclient->sock < 0)
|
if (!bgp_zclient || bgp_zclient->sock < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("Registering %s", bgp->name_pretty);
|
zlog_debug("Registering %s", bgp->name_pretty);
|
||||||
|
|
||||||
/* Register for router-id, interfaces, redistributed routes. */
|
/* Register for router-id, interfaces, redistributed routes. */
|
||||||
zclient_send_reg_requests(zclient, bgp->vrf_id);
|
zclient_send_reg_requests(bgp_zclient, bgp->vrf_id);
|
||||||
|
|
||||||
/* For EVPN instance, register to learn about VNIs, if appropriate. */
|
/* For EVPN instance, register to learn about VNIs, if appropriate. */
|
||||||
if (bgp->advertise_all_vni)
|
if (bgp->advertise_all_vni)
|
||||||
|
@ -2364,7 +2364,7 @@ void bgp_zebra_instance_register(struct bgp *bgp)
|
||||||
void bgp_zebra_instance_deregister(struct bgp *bgp)
|
void bgp_zebra_instance_deregister(struct bgp *bgp)
|
||||||
{
|
{
|
||||||
/* Don't try to deregister if we're not connected to Zebra */
|
/* Don't try to deregister if we're not connected to Zebra */
|
||||||
if (zclient->sock < 0)
|
if (bgp_zclient->sock < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
|
@ -2375,7 +2375,7 @@ void bgp_zebra_instance_deregister(struct bgp *bgp)
|
||||||
bgp_zebra_advertise_all_vni(bgp, 0);
|
bgp_zebra_advertise_all_vni(bgp, 0);
|
||||||
|
|
||||||
/* Deregister for router-id, interfaces, redistributed routes. */
|
/* Deregister for router-id, interfaces, redistributed routes. */
|
||||||
zclient_send_dereg_requests(zclient, bgp->vrf_id);
|
zclient_send_dereg_requests(bgp_zclient, bgp->vrf_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void bgp_zebra_initiate_radv(struct bgp *bgp, struct peer *peer)
|
void bgp_zebra_initiate_radv(struct bgp *bgp, struct peer *peer)
|
||||||
|
@ -2386,7 +2386,7 @@ void bgp_zebra_initiate_radv(struct bgp *bgp, struct peer *peer)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Don't try to initiate if we're not connected to Zebra */
|
/* Don't try to initiate if we're not connected to Zebra */
|
||||||
if (zclient->sock < 0)
|
if (bgp_zclient->sock < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
|
@ -2398,7 +2398,7 @@ void bgp_zebra_initiate_radv(struct bgp *bgp, struct peer *peer)
|
||||||
* If we don't have an ifp pointer, call function to find the
|
* If we don't have an ifp pointer, call function to find the
|
||||||
* ifps for a numbered enhe peer to turn RAs on.
|
* ifps for a numbered enhe peer to turn RAs on.
|
||||||
*/
|
*/
|
||||||
peer->ifp ? zclient_send_interface_radv_req(zclient, bgp->vrf_id,
|
peer->ifp ? zclient_send_interface_radv_req(bgp_zclient, bgp->vrf_id,
|
||||||
peer->ifp, 1, ra_interval)
|
peer->ifp, 1, ra_interval)
|
||||||
: bgp_nht_reg_enhe_cap_intfs(peer);
|
: bgp_nht_reg_enhe_cap_intfs(peer);
|
||||||
}
|
}
|
||||||
|
@ -2406,7 +2406,7 @@ void bgp_zebra_initiate_radv(struct bgp *bgp, struct peer *peer)
|
||||||
void bgp_zebra_terminate_radv(struct bgp *bgp, struct peer *peer)
|
void bgp_zebra_terminate_radv(struct bgp *bgp, struct peer *peer)
|
||||||
{
|
{
|
||||||
/* Don't try to terminate if we're not connected to Zebra */
|
/* Don't try to terminate if we're not connected to Zebra */
|
||||||
if (zclient->sock < 0)
|
if (bgp_zclient->sock < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
|
@ -2418,7 +2418,7 @@ void bgp_zebra_terminate_radv(struct bgp *bgp, struct peer *peer)
|
||||||
* If we don't have an ifp pointer, call function to find the
|
* If we don't have an ifp pointer, call function to find the
|
||||||
* ifps for a numbered enhe peer to turn RAs off.
|
* ifps for a numbered enhe peer to turn RAs off.
|
||||||
*/
|
*/
|
||||||
peer->ifp ? zclient_send_interface_radv_req(zclient, bgp->vrf_id,
|
peer->ifp ? zclient_send_interface_radv_req(bgp_zclient, bgp->vrf_id,
|
||||||
peer->ifp, 0, 0)
|
peer->ifp, 0, 0)
|
||||||
: bgp_nht_dereg_enhe_cap_intfs(peer);
|
: bgp_nht_dereg_enhe_cap_intfs(peer);
|
||||||
}
|
}
|
||||||
|
@ -2428,7 +2428,7 @@ int bgp_zebra_advertise_subnet(struct bgp *bgp, int advertise, vni_t vni)
|
||||||
struct stream *s = NULL;
|
struct stream *s = NULL;
|
||||||
|
|
||||||
/* Check socket. */
|
/* Check socket. */
|
||||||
if (!zclient || zclient->sock < 0)
|
if (!bgp_zclient || bgp_zclient->sock < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Don't try to register if Zebra doesn't know of this instance. */
|
/* Don't try to register if Zebra doesn't know of this instance. */
|
||||||
|
@ -2440,7 +2440,7 @@ int bgp_zebra_advertise_subnet(struct bgp *bgp, int advertise, vni_t vni)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
s = zclient->obuf;
|
s = bgp_zclient->obuf;
|
||||||
stream_reset(s);
|
stream_reset(s);
|
||||||
|
|
||||||
zclient_create_header(s, ZEBRA_ADVERTISE_SUBNET, bgp->vrf_id);
|
zclient_create_header(s, ZEBRA_ADVERTISE_SUBNET, bgp->vrf_id);
|
||||||
|
@ -2448,7 +2448,7 @@ int bgp_zebra_advertise_subnet(struct bgp *bgp, int advertise, vni_t vni)
|
||||||
stream_put3(s, vni);
|
stream_put3(s, vni);
|
||||||
stream_putw_at(s, 0, stream_get_endp(s));
|
stream_putw_at(s, 0, stream_get_endp(s));
|
||||||
|
|
||||||
return zclient_send_message(zclient);
|
return zclient_send_message(bgp_zclient);
|
||||||
}
|
}
|
||||||
|
|
||||||
int bgp_zebra_advertise_svi_macip(struct bgp *bgp, int advertise, vni_t vni)
|
int bgp_zebra_advertise_svi_macip(struct bgp *bgp, int advertise, vni_t vni)
|
||||||
|
@ -2456,14 +2456,14 @@ int bgp_zebra_advertise_svi_macip(struct bgp *bgp, int advertise, vni_t vni)
|
||||||
struct stream *s = NULL;
|
struct stream *s = NULL;
|
||||||
|
|
||||||
/* Check socket. */
|
/* Check socket. */
|
||||||
if (!zclient || zclient->sock < 0)
|
if (!bgp_zclient || bgp_zclient->sock < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Don't try to register if Zebra doesn't know of this instance. */
|
/* Don't try to register if Zebra doesn't know of this instance. */
|
||||||
if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp))
|
if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
s = zclient->obuf;
|
s = bgp_zclient->obuf;
|
||||||
stream_reset(s);
|
stream_reset(s);
|
||||||
|
|
||||||
zclient_create_header(s, ZEBRA_ADVERTISE_SVI_MACIP, bgp->vrf_id);
|
zclient_create_header(s, ZEBRA_ADVERTISE_SVI_MACIP, bgp->vrf_id);
|
||||||
|
@ -2471,7 +2471,7 @@ int bgp_zebra_advertise_svi_macip(struct bgp *bgp, int advertise, vni_t vni)
|
||||||
stream_putl(s, vni);
|
stream_putl(s, vni);
|
||||||
stream_putw_at(s, 0, stream_get_endp(s));
|
stream_putw_at(s, 0, stream_get_endp(s));
|
||||||
|
|
||||||
return zclient_send_message(zclient);
|
return zclient_send_message(bgp_zclient);
|
||||||
}
|
}
|
||||||
|
|
||||||
int bgp_zebra_advertise_gw_macip(struct bgp *bgp, int advertise, vni_t vni)
|
int bgp_zebra_advertise_gw_macip(struct bgp *bgp, int advertise, vni_t vni)
|
||||||
|
@ -2479,7 +2479,7 @@ int bgp_zebra_advertise_gw_macip(struct bgp *bgp, int advertise, vni_t vni)
|
||||||
struct stream *s = NULL;
|
struct stream *s = NULL;
|
||||||
|
|
||||||
/* Check socket. */
|
/* Check socket. */
|
||||||
if (!zclient || zclient->sock < 0)
|
if (!bgp_zclient || bgp_zclient->sock < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Don't try to register if Zebra doesn't know of this instance. */
|
/* Don't try to register if Zebra doesn't know of this instance. */
|
||||||
|
@ -2491,7 +2491,7 @@ int bgp_zebra_advertise_gw_macip(struct bgp *bgp, int advertise, vni_t vni)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
s = zclient->obuf;
|
s = bgp_zclient->obuf;
|
||||||
stream_reset(s);
|
stream_reset(s);
|
||||||
|
|
||||||
zclient_create_header(s, ZEBRA_ADVERTISE_DEFAULT_GW, bgp->vrf_id);
|
zclient_create_header(s, ZEBRA_ADVERTISE_DEFAULT_GW, bgp->vrf_id);
|
||||||
|
@ -2499,7 +2499,7 @@ int bgp_zebra_advertise_gw_macip(struct bgp *bgp, int advertise, vni_t vni)
|
||||||
stream_putl(s, vni);
|
stream_putl(s, vni);
|
||||||
stream_putw_at(s, 0, stream_get_endp(s));
|
stream_putw_at(s, 0, stream_get_endp(s));
|
||||||
|
|
||||||
return zclient_send_message(zclient);
|
return zclient_send_message(bgp_zclient);
|
||||||
}
|
}
|
||||||
|
|
||||||
int bgp_zebra_vxlan_flood_control(struct bgp *bgp,
|
int bgp_zebra_vxlan_flood_control(struct bgp *bgp,
|
||||||
|
@ -2508,7 +2508,7 @@ int bgp_zebra_vxlan_flood_control(struct bgp *bgp,
|
||||||
struct stream *s;
|
struct stream *s;
|
||||||
|
|
||||||
/* Check socket. */
|
/* Check socket. */
|
||||||
if (!zclient || zclient->sock < 0)
|
if (!bgp_zclient || bgp_zclient->sock < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Don't try to register if Zebra doesn't know of this instance. */
|
/* Don't try to register if Zebra doesn't know of this instance. */
|
||||||
|
@ -2520,14 +2520,14 @@ int bgp_zebra_vxlan_flood_control(struct bgp *bgp,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
s = zclient->obuf;
|
s = bgp_zclient->obuf;
|
||||||
stream_reset(s);
|
stream_reset(s);
|
||||||
|
|
||||||
zclient_create_header(s, ZEBRA_VXLAN_FLOOD_CONTROL, bgp->vrf_id);
|
zclient_create_header(s, ZEBRA_VXLAN_FLOOD_CONTROL, bgp->vrf_id);
|
||||||
stream_putc(s, flood_ctrl);
|
stream_putc(s, flood_ctrl);
|
||||||
stream_putw_at(s, 0, stream_get_endp(s));
|
stream_putw_at(s, 0, stream_get_endp(s));
|
||||||
|
|
||||||
return zclient_send_message(zclient);
|
return zclient_send_message(bgp_zclient);
|
||||||
}
|
}
|
||||||
|
|
||||||
int bgp_zebra_advertise_all_vni(struct bgp *bgp, int advertise)
|
int bgp_zebra_advertise_all_vni(struct bgp *bgp, int advertise)
|
||||||
|
@ -2535,14 +2535,14 @@ int bgp_zebra_advertise_all_vni(struct bgp *bgp, int advertise)
|
||||||
struct stream *s;
|
struct stream *s;
|
||||||
|
|
||||||
/* Check socket. */
|
/* Check socket. */
|
||||||
if (!zclient || zclient->sock < 0)
|
if (!bgp_zclient || bgp_zclient->sock < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Don't try to register if Zebra doesn't know of this instance. */
|
/* Don't try to register if Zebra doesn't know of this instance. */
|
||||||
if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp))
|
if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
s = zclient->obuf;
|
s = bgp_zclient->obuf;
|
||||||
stream_reset(s);
|
stream_reset(s);
|
||||||
|
|
||||||
zclient_create_header(s, ZEBRA_ADVERTISE_ALL_VNI, bgp->vrf_id);
|
zclient_create_header(s, ZEBRA_ADVERTISE_ALL_VNI, bgp->vrf_id);
|
||||||
|
@ -2553,7 +2553,7 @@ int bgp_zebra_advertise_all_vni(struct bgp *bgp, int advertise)
|
||||||
stream_putc(s, bgp->vxlan_flood_ctrl);
|
stream_putc(s, bgp->vxlan_flood_ctrl);
|
||||||
stream_putw_at(s, 0, stream_get_endp(s));
|
stream_putw_at(s, 0, stream_get_endp(s));
|
||||||
|
|
||||||
return zclient_send_message(zclient);
|
return zclient_send_message(bgp_zclient);
|
||||||
}
|
}
|
||||||
|
|
||||||
int bgp_zebra_dup_addr_detection(struct bgp *bgp)
|
int bgp_zebra_dup_addr_detection(struct bgp *bgp)
|
||||||
|
@ -2561,7 +2561,7 @@ int bgp_zebra_dup_addr_detection(struct bgp *bgp)
|
||||||
struct stream *s;
|
struct stream *s;
|
||||||
|
|
||||||
/* Check socket. */
|
/* Check socket. */
|
||||||
if (!zclient || zclient->sock < 0)
|
if (!bgp_zclient || bgp_zclient->sock < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Don't try to register if Zebra doesn't know of this instance. */
|
/* Don't try to register if Zebra doesn't know of this instance. */
|
||||||
|
@ -2578,7 +2578,7 @@ int bgp_zebra_dup_addr_detection(struct bgp *bgp)
|
||||||
"enable" : "disable",
|
"enable" : "disable",
|
||||||
bgp->evpn_info->dad_freeze_time);
|
bgp->evpn_info->dad_freeze_time);
|
||||||
|
|
||||||
s = zclient->obuf;
|
s = bgp_zclient->obuf;
|
||||||
stream_reset(s);
|
stream_reset(s);
|
||||||
zclient_create_header(s, ZEBRA_DUPLICATE_ADDR_DETECTION,
|
zclient_create_header(s, ZEBRA_DUPLICATE_ADDR_DETECTION,
|
||||||
bgp->vrf_id);
|
bgp->vrf_id);
|
||||||
|
@ -2589,7 +2589,7 @@ int bgp_zebra_dup_addr_detection(struct bgp *bgp)
|
||||||
stream_putl(s, bgp->evpn_info->dad_freeze_time);
|
stream_putl(s, bgp->evpn_info->dad_freeze_time);
|
||||||
stream_putw_at(s, 0, stream_get_endp(s));
|
stream_putw_at(s, 0, stream_get_endp(s));
|
||||||
|
|
||||||
return zclient_send_message(zclient);
|
return zclient_send_message(bgp_zclient);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rule_notify_owner(ZAPI_CALLBACK_ARGS)
|
static int rule_notify_owner(ZAPI_CALLBACK_ARGS)
|
||||||
|
@ -3965,7 +3965,7 @@ void bgp_if_init(void)
|
||||||
|
|
||||||
static bool bgp_zebra_label_manager_ready(void)
|
static bool bgp_zebra_label_manager_ready(void)
|
||||||
{
|
{
|
||||||
return (zclient_sync->sock > 0);
|
return (bgp_zclient_sync->sock > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bgp_start_label_manager(struct event *start)
|
static void bgp_start_label_manager(struct event *start)
|
||||||
|
@ -3979,29 +3979,29 @@ static void bgp_start_label_manager(struct event *start)
|
||||||
static bool bgp_zebra_label_manager_connect(void)
|
static bool bgp_zebra_label_manager_connect(void)
|
||||||
{
|
{
|
||||||
/* Connect to label manager. */
|
/* Connect to label manager. */
|
||||||
if (zclient_socket_connect(zclient_sync) < 0) {
|
if (zclient_socket_connect(bgp_zclient_sync) < 0) {
|
||||||
zlog_warn("%s: failed connecting synchronous zclient!",
|
zlog_warn("%s: failed connecting synchronous zclient!",
|
||||||
__func__);
|
__func__);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
/* make socket non-blocking */
|
/* make socket non-blocking */
|
||||||
set_nonblocking(zclient_sync->sock);
|
set_nonblocking(bgp_zclient_sync->sock);
|
||||||
|
|
||||||
/* Send hello to notify zebra this is a synchronous client */
|
/* Send hello to notify zebra this is a synchronous client */
|
||||||
if (zclient_send_hello(zclient_sync) == ZCLIENT_SEND_FAILURE) {
|
if (zclient_send_hello(bgp_zclient_sync) == ZCLIENT_SEND_FAILURE) {
|
||||||
zlog_warn("%s: failed sending hello for synchronous zclient!",
|
zlog_warn("%s: failed sending hello for synchronous zclient!",
|
||||||
__func__);
|
__func__);
|
||||||
close(zclient_sync->sock);
|
close(bgp_zclient_sync->sock);
|
||||||
zclient_sync->sock = -1;
|
bgp_zclient_sync->sock = -1;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Connect to label manager */
|
/* Connect to label manager */
|
||||||
if (lm_label_manager_connect(zclient_sync, 0) != 0) {
|
if (lm_label_manager_connect(bgp_zclient_sync, 0) != 0) {
|
||||||
zlog_warn("%s: failed connecting to label manager!", __func__);
|
zlog_warn("%s: failed connecting to label manager!", __func__);
|
||||||
if (zclient_sync->sock > 0) {
|
if (bgp_zclient_sync->sock > 0) {
|
||||||
close(zclient_sync->sock);
|
close(bgp_zclient_sync->sock);
|
||||||
zclient_sync->sock = -1;
|
bgp_zclient_sync->sock = -1;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -4030,22 +4030,22 @@ void bgp_zebra_init(struct event_loop *master, unsigned short instance)
|
||||||
hook_register_prio(if_unreal, 0, bgp_ifp_destroy);
|
hook_register_prio(if_unreal, 0, bgp_ifp_destroy);
|
||||||
|
|
||||||
/* Set default values. */
|
/* Set default values. */
|
||||||
zclient = zclient_new(master, &zclient_options_default, bgp_handlers,
|
bgp_zclient = zclient_new(master, &zclient_options_default, bgp_handlers,
|
||||||
array_size(bgp_handlers));
|
array_size(bgp_handlers));
|
||||||
zclient_init(zclient, ZEBRA_ROUTE_BGP, 0, &bgpd_privs);
|
zclient_init(bgp_zclient, ZEBRA_ROUTE_BGP, 0, &bgpd_privs);
|
||||||
zclient->zebra_buffer_write_ready = bgp_zebra_buffer_write_ready;
|
bgp_zclient->zebra_buffer_write_ready = bgp_zebra_buffer_write_ready;
|
||||||
zclient->zebra_connected = bgp_zebra_connected;
|
bgp_zclient->zebra_connected = bgp_zebra_connected;
|
||||||
zclient->zebra_capabilities = bgp_zebra_capabilities;
|
bgp_zclient->zebra_capabilities = bgp_zebra_capabilities;
|
||||||
zclient->nexthop_update = bgp_nexthop_update;
|
bgp_zclient->nexthop_update = bgp_nexthop_update;
|
||||||
zclient->instance = instance;
|
bgp_zclient->instance = instance;
|
||||||
|
|
||||||
/* Initialize special zclient for synchronous message exchanges. */
|
/* Initialize special zclient for synchronous message exchanges. */
|
||||||
zclient_sync = zclient_new(master, &zclient_options_sync, NULL, 0);
|
bgp_zclient_sync = zclient_new(master, &zclient_options_sync, NULL, 0);
|
||||||
zclient_sync->sock = -1;
|
bgp_zclient_sync->sock = -1;
|
||||||
zclient_sync->redist_default = ZEBRA_ROUTE_BGP;
|
bgp_zclient_sync->redist_default = ZEBRA_ROUTE_BGP;
|
||||||
zclient_sync->instance = instance;
|
bgp_zclient_sync->instance = instance;
|
||||||
zclient_sync->session_id = 1;
|
bgp_zclient_sync->session_id = 1;
|
||||||
zclient_sync->privs = &bgpd_privs;
|
bgp_zclient_sync->privs = &bgpd_privs;
|
||||||
|
|
||||||
if (!bgp_zebra_label_manager_ready())
|
if (!bgp_zebra_label_manager_ready())
|
||||||
event_add_timer(master, bgp_start_label_manager, NULL, 1,
|
event_add_timer(master, bgp_start_label_manager, NULL, 1,
|
||||||
|
@ -4054,17 +4054,17 @@ void bgp_zebra_init(struct event_loop *master, unsigned short instance)
|
||||||
|
|
||||||
void bgp_zebra_destroy(void)
|
void bgp_zebra_destroy(void)
|
||||||
{
|
{
|
||||||
if (zclient == NULL)
|
if (bgp_zclient == NULL)
|
||||||
return;
|
return;
|
||||||
zclient_stop(zclient);
|
zclient_stop(bgp_zclient);
|
||||||
zclient_free(zclient);
|
zclient_free(bgp_zclient);
|
||||||
zclient = NULL;
|
bgp_zclient = NULL;
|
||||||
|
|
||||||
if (zclient_sync == NULL)
|
if (bgp_zclient_sync == NULL)
|
||||||
return;
|
return;
|
||||||
zclient_stop(zclient_sync);
|
zclient_stop(bgp_zclient_sync);
|
||||||
zclient_free(zclient_sync);
|
zclient_free(bgp_zclient_sync);
|
||||||
zclient_sync = NULL;
|
bgp_zclient_sync = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int bgp_zebra_num_connects(void)
|
int bgp_zebra_num_connects(void)
|
||||||
|
@ -4090,7 +4090,7 @@ void bgp_send_pbr_rule_action(struct bgp_pbr_action *pbra,
|
||||||
zlog_debug("%s: table %d fwmark %d %d", __func__,
|
zlog_debug("%s: table %d fwmark %d %d", __func__,
|
||||||
pbra->table_id, pbra->fwmark, install);
|
pbra->table_id, pbra->fwmark, install);
|
||||||
}
|
}
|
||||||
s = zclient->obuf;
|
s = bgp_zclient->obuf;
|
||||||
stream_reset(s);
|
stream_reset(s);
|
||||||
|
|
||||||
zclient_create_header(s,
|
zclient_create_header(s,
|
||||||
|
@ -4099,7 +4099,7 @@ void bgp_send_pbr_rule_action(struct bgp_pbr_action *pbra,
|
||||||
|
|
||||||
bgp_encode_pbr_rule_action(s, pbra, pbr);
|
bgp_encode_pbr_rule_action(s, pbra, pbr);
|
||||||
|
|
||||||
if ((zclient_send_message(zclient) != ZCLIENT_SEND_FAILURE)
|
if ((zclient_send_message(bgp_zclient) != ZCLIENT_SEND_FAILURE)
|
||||||
&& install) {
|
&& install) {
|
||||||
if (!pbr)
|
if (!pbr)
|
||||||
pbra->install_in_progress = true;
|
pbra->install_in_progress = true;
|
||||||
|
@ -4118,7 +4118,7 @@ void bgp_send_pbr_ipset_match(struct bgp_pbr_match *pbrim, bool install)
|
||||||
zlog_debug("%s: name %s type %d %d, ID %u", __func__,
|
zlog_debug("%s: name %s type %d %d, ID %u", __func__,
|
||||||
pbrim->ipset_name, pbrim->type, install,
|
pbrim->ipset_name, pbrim->type, install,
|
||||||
pbrim->unique);
|
pbrim->unique);
|
||||||
s = zclient->obuf;
|
s = bgp_zclient->obuf;
|
||||||
stream_reset(s);
|
stream_reset(s);
|
||||||
|
|
||||||
zclient_create_header(s,
|
zclient_create_header(s,
|
||||||
|
@ -4131,7 +4131,7 @@ void bgp_send_pbr_ipset_match(struct bgp_pbr_match *pbrim, bool install)
|
||||||
bgp_encode_pbr_ipset_match(s, pbrim);
|
bgp_encode_pbr_ipset_match(s, pbrim);
|
||||||
|
|
||||||
stream_putw_at(s, 0, stream_get_endp(s));
|
stream_putw_at(s, 0, stream_get_endp(s));
|
||||||
if ((zclient_send_message(zclient) != ZCLIENT_SEND_FAILURE) && install)
|
if ((zclient_send_message(bgp_zclient) != ZCLIENT_SEND_FAILURE) && install)
|
||||||
pbrim->install_in_progress = true;
|
pbrim->install_in_progress = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4146,7 +4146,7 @@ void bgp_send_pbr_ipset_entry_match(struct bgp_pbr_match_entry *pbrime,
|
||||||
zlog_debug("%s: name %s %d %d, ID %u", __func__,
|
zlog_debug("%s: name %s %d %d, ID %u", __func__,
|
||||||
pbrime->backpointer->ipset_name, pbrime->unique,
|
pbrime->backpointer->ipset_name, pbrime->unique,
|
||||||
install, pbrime->unique);
|
install, pbrime->unique);
|
||||||
s = zclient->obuf;
|
s = bgp_zclient->obuf;
|
||||||
stream_reset(s);
|
stream_reset(s);
|
||||||
|
|
||||||
zclient_create_header(s,
|
zclient_create_header(s,
|
||||||
|
@ -4159,7 +4159,7 @@ void bgp_send_pbr_ipset_entry_match(struct bgp_pbr_match_entry *pbrime,
|
||||||
bgp_encode_pbr_ipset_entry_match(s, pbrime);
|
bgp_encode_pbr_ipset_entry_match(s, pbrime);
|
||||||
|
|
||||||
stream_putw_at(s, 0, stream_get_endp(s));
|
stream_putw_at(s, 0, stream_get_endp(s));
|
||||||
if ((zclient_send_message(zclient) != ZCLIENT_SEND_FAILURE) && install)
|
if ((zclient_send_message(bgp_zclient) != ZCLIENT_SEND_FAILURE) && install)
|
||||||
pbrime->install_in_progress = true;
|
pbrime->install_in_progress = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4218,7 +4218,7 @@ void bgp_send_pbr_iptable(struct bgp_pbr_action *pba,
|
||||||
zlog_debug("%s: name %s type %d mark %d %d, ID %u", __func__,
|
zlog_debug("%s: name %s type %d mark %d %d, ID %u", __func__,
|
||||||
pbm->ipset_name, pbm->type, pba->fwmark, install,
|
pbm->ipset_name, pbm->type, pba->fwmark, install,
|
||||||
pbm->unique2);
|
pbm->unique2);
|
||||||
s = zclient->obuf;
|
s = bgp_zclient->obuf;
|
||||||
stream_reset(s);
|
stream_reset(s);
|
||||||
|
|
||||||
zclient_create_header(s,
|
zclient_create_header(s,
|
||||||
|
@ -4232,7 +4232,7 @@ void bgp_send_pbr_iptable(struct bgp_pbr_action *pba,
|
||||||
if (nb_interface)
|
if (nb_interface)
|
||||||
bgp_encode_pbr_interface_list(pba->bgp, s, pbm->family);
|
bgp_encode_pbr_interface_list(pba->bgp, s, pbm->family);
|
||||||
stream_putw_at(s, 0, stream_get_endp(s));
|
stream_putw_at(s, 0, stream_get_endp(s));
|
||||||
ret = zclient_send_message(zclient);
|
ret = zclient_send_message(bgp_zclient);
|
||||||
if (install) {
|
if (install) {
|
||||||
if (ret != ZCLIENT_SEND_FAILURE)
|
if (ret != ZCLIENT_SEND_FAILURE)
|
||||||
pba->refcnt++;
|
pba->refcnt++;
|
||||||
|
@ -4319,7 +4319,7 @@ void bgp_zebra_announce_default(struct bgp *bgp, struct nexthop *nh,
|
||||||
}
|
}
|
||||||
|
|
||||||
zclient_route_send(announce ? ZEBRA_ROUTE_ADD : ZEBRA_ROUTE_DELETE,
|
zclient_route_send(announce ? ZEBRA_ROUTE_ADD : ZEBRA_ROUTE_DELETE,
|
||||||
zclient, &api);
|
bgp_zclient, &api);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Send capabilities to RIB */
|
/* Send capabilities to RIB */
|
||||||
|
@ -4332,7 +4332,7 @@ int bgp_zebra_send_capabilities(struct bgp *bgp, bool disable)
|
||||||
zlog_debug("%s: Sending %sable for %s", __func__,
|
zlog_debug("%s: Sending %sable for %s", __func__,
|
||||||
disable ? "dis" : "en", bgp->name_pretty);
|
disable ? "dis" : "en", bgp->name_pretty);
|
||||||
|
|
||||||
if (zclient == NULL) {
|
if (bgp_zclient == NULL) {
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: %s zclient invalid", __func__,
|
zlog_debug("%s: %s zclient invalid", __func__,
|
||||||
bgp->name_pretty);
|
bgp->name_pretty);
|
||||||
|
@ -4340,7 +4340,7 @@ int bgp_zebra_send_capabilities(struct bgp *bgp, bool disable)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if the client is connected */
|
/* Check if the client is connected */
|
||||||
if ((zclient->sock < 0) || (zclient->t_connect)) {
|
if ((bgp_zclient->sock < 0) || (bgp_zclient->t_connect)) {
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: %s client not connected", __func__,
|
zlog_debug("%s: %s client not connected", __func__,
|
||||||
bgp->name_pretty);
|
bgp->name_pretty);
|
||||||
|
@ -4365,7 +4365,7 @@ int bgp_zebra_send_capabilities(struct bgp *bgp, bool disable)
|
||||||
api.vrf_id = bgp->vrf_id;
|
api.vrf_id = bgp->vrf_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zclient_capabilities_send(ZEBRA_CLIENT_CAPABILITIES, zclient, &api)
|
if (zclient_capabilities_send(ZEBRA_CLIENT_CAPABILITIES, bgp_zclient, &api)
|
||||||
== ZCLIENT_SEND_FAILURE) {
|
== ZCLIENT_SEND_FAILURE) {
|
||||||
zlog_err("%s(%d): Error sending GR capability to zebra",
|
zlog_err("%s(%d): Error sending GR capability to zebra",
|
||||||
bgp->name_pretty, bgp->vrf_id);
|
bgp->name_pretty, bgp->vrf_id);
|
||||||
|
@ -4394,7 +4394,7 @@ int bgp_zebra_update(struct bgp *bgp, afi_t afi, safi_t safi,
|
||||||
bgp->name_pretty, afi, safi,
|
bgp->name_pretty, afi, safi,
|
||||||
zserv_gr_client_cap_string(type));
|
zserv_gr_client_cap_string(type));
|
||||||
|
|
||||||
if (zclient == NULL) {
|
if (bgp_zclient == NULL) {
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: %s zclient == NULL, invalid", __func__,
|
zlog_debug("%s: %s zclient == NULL, invalid", __func__,
|
||||||
bgp->name_pretty);
|
bgp->name_pretty);
|
||||||
|
@ -4402,7 +4402,7 @@ int bgp_zebra_update(struct bgp *bgp, afi_t afi, safi_t safi,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if the client is connected */
|
/* Check if the client is connected */
|
||||||
if ((zclient->sock < 0) || (zclient->t_connect)) {
|
if ((bgp_zclient->sock < 0) || (bgp_zclient->t_connect)) {
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: %s client not connected", __func__,
|
zlog_debug("%s: %s client not connected", __func__,
|
||||||
bgp->name_pretty);
|
bgp->name_pretty);
|
||||||
|
@ -4414,7 +4414,7 @@ int bgp_zebra_update(struct bgp *bgp, afi_t afi, safi_t safi,
|
||||||
api.vrf_id = bgp->vrf_id;
|
api.vrf_id = bgp->vrf_id;
|
||||||
api.cap = type;
|
api.cap = type;
|
||||||
|
|
||||||
if (zclient_capabilities_send(ZEBRA_CLIENT_CAPABILITIES, zclient, &api)
|
if (zclient_capabilities_send(ZEBRA_CLIENT_CAPABILITIES, bgp_zclient, &api)
|
||||||
== ZCLIENT_SEND_FAILURE) {
|
== ZCLIENT_SEND_FAILURE) {
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: %s error sending capability", __func__,
|
zlog_debug("%s: %s error sending capability", __func__,
|
||||||
|
@ -4434,14 +4434,14 @@ int bgp_zebra_stale_timer_update(struct bgp *bgp)
|
||||||
zlog_debug("%s: %s Timer Update to %u", __func__,
|
zlog_debug("%s: %s Timer Update to %u", __func__,
|
||||||
bgp->name_pretty, bgp->rib_stale_time);
|
bgp->name_pretty, bgp->rib_stale_time);
|
||||||
|
|
||||||
if (zclient == NULL) {
|
if (bgp_zclient == NULL) {
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("zclient invalid");
|
zlog_debug("zclient invalid");
|
||||||
return BGP_GR_FAILURE;
|
return BGP_GR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if the client is connected */
|
/* Check if the client is connected */
|
||||||
if ((zclient->sock < 0) || (zclient->t_connect)) {
|
if ((bgp_zclient->sock < 0) || (bgp_zclient->t_connect)) {
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: %s client not connected", __func__,
|
zlog_debug("%s: %s client not connected", __func__,
|
||||||
bgp->name_pretty);
|
bgp->name_pretty);
|
||||||
|
@ -4452,7 +4452,7 @@ int bgp_zebra_stale_timer_update(struct bgp *bgp)
|
||||||
api.cap = ZEBRA_CLIENT_RIB_STALE_TIME;
|
api.cap = ZEBRA_CLIENT_RIB_STALE_TIME;
|
||||||
api.stale_removal_time = bgp->rib_stale_time;
|
api.stale_removal_time = bgp->rib_stale_time;
|
||||||
api.vrf_id = bgp->vrf_id;
|
api.vrf_id = bgp->vrf_id;
|
||||||
if (zclient_capabilities_send(ZEBRA_CLIENT_CAPABILITIES, zclient, &api)
|
if (zclient_capabilities_send(ZEBRA_CLIENT_CAPABILITIES, bgp_zclient, &api)
|
||||||
== ZCLIENT_SEND_FAILURE) {
|
== ZCLIENT_SEND_FAILURE) {
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("%s: %s error sending capability", __func__,
|
zlog_debug("%s: %s error sending capability", __func__,
|
||||||
|
@ -4465,12 +4465,12 @@ int bgp_zebra_stale_timer_update(struct bgp *bgp)
|
||||||
|
|
||||||
int bgp_zebra_srv6_manager_get_locator_chunk(const char *name)
|
int bgp_zebra_srv6_manager_get_locator_chunk(const char *name)
|
||||||
{
|
{
|
||||||
return srv6_manager_get_locator_chunk(zclient, name);
|
return srv6_manager_get_locator_chunk(bgp_zclient, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
int bgp_zebra_srv6_manager_release_locator_chunk(const char *name)
|
int bgp_zebra_srv6_manager_release_locator_chunk(const char *name)
|
||||||
{
|
{
|
||||||
return srv6_manager_release_locator_chunk(zclient, name);
|
return srv6_manager_release_locator_chunk(bgp_zclient, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4488,7 +4488,7 @@ int bgp_zebra_srv6_manager_get_locator(const char *name)
|
||||||
* Send the Get Locator request to the SRv6 Manager and return the
|
* Send the Get Locator request to the SRv6 Manager and return the
|
||||||
* result
|
* result
|
||||||
*/
|
*/
|
||||||
return srv6_manager_get_locator(zclient, name);
|
return srv6_manager_get_locator(bgp_zclient, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4520,7 +4520,7 @@ bool bgp_zebra_request_srv6_sid(const struct srv6_sid_ctx *ctx,
|
||||||
* Send the Get SRv6 SID request to the SRv6 Manager and check the
|
* Send the Get SRv6 SID request to the SRv6 Manager and check the
|
||||||
* result
|
* result
|
||||||
*/
|
*/
|
||||||
ret = srv6_manager_get_sid(zclient, ctx, sid_value, locator_name,
|
ret = srv6_manager_get_sid(bgp_zclient, ctx, sid_value, locator_name,
|
||||||
sid_func);
|
sid_func);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
zlog_warn("%s: error getting SRv6 SID!", __func__);
|
zlog_warn("%s: error getting SRv6 SID!", __func__);
|
||||||
|
@ -4549,7 +4549,7 @@ void bgp_zebra_release_srv6_sid(const struct srv6_sid_ctx *ctx)
|
||||||
* Send the Release SRv6 SID request to the SRv6 Manager and check the
|
* Send the Release SRv6 SID request to the SRv6 Manager and check the
|
||||||
* result
|
* result
|
||||||
*/
|
*/
|
||||||
ret = srv6_manager_release_sid(zclient, ctx);
|
ret = srv6_manager_release_sid(bgp_zclient, ctx);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
zlog_warn("%s: error releasing SRv6 SID!", __func__);
|
zlog_warn("%s: error releasing SRv6 SID!", __func__);
|
||||||
return;
|
return;
|
||||||
|
@ -4592,7 +4592,7 @@ void bgp_zebra_send_nexthop_label(int cmd, mpls_label_t label,
|
||||||
znh->labels[i] = out_labels[i];
|
znh->labels[i] = out_labels[i];
|
||||||
}
|
}
|
||||||
/* vrf_id is DEFAULT_VRF */
|
/* vrf_id is DEFAULT_VRF */
|
||||||
zebra_send_mpls_labels(zclient, cmd, &zl);
|
zebra_send_mpls_labels(bgp_zclient, cmd, &zl);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool bgp_zebra_request_label_range(uint32_t base, uint32_t chunk_size,
|
bool bgp_zebra_request_label_range(uint32_t base, uint32_t chunk_size,
|
||||||
|
@ -4601,10 +4601,10 @@ bool bgp_zebra_request_label_range(uint32_t base, uint32_t chunk_size,
|
||||||
int ret;
|
int ret;
|
||||||
uint32_t start, end;
|
uint32_t start, end;
|
||||||
|
|
||||||
if (!zclient_sync || !bgp_zebra_label_manager_ready())
|
if (!bgp_zclient_sync || !bgp_zebra_label_manager_ready())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ret = lm_get_label_chunk(zclient_sync, 0, base, chunk_size, &start,
|
ret = lm_get_label_chunk(bgp_zclient_sync, 0, base, chunk_size, &start,
|
||||||
&end);
|
&end);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
zlog_warn("%s: error getting label range!", __func__);
|
zlog_warn("%s: error getting label range!", __func__);
|
||||||
|
@ -4633,10 +4633,10 @@ void bgp_zebra_release_label_range(uint32_t start, uint32_t end)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!zclient_sync || !bgp_zebra_label_manager_ready())
|
if (!bgp_zclient_sync || !bgp_zebra_label_manager_ready())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ret = lm_release_label_chunk(zclient_sync, start, end);
|
ret = lm_release_label_chunk(bgp_zclient_sync, start, end);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
zlog_warn("%s: error releasing label range!", __func__);
|
zlog_warn("%s: error releasing label range!", __func__);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,9 @@
|
||||||
|
|
||||||
#include "vxlan.h"
|
#include "vxlan.h"
|
||||||
|
|
||||||
|
/* The global zapi session handle */
|
||||||
|
extern struct zclient *bgp_zclient;
|
||||||
|
|
||||||
/* Macro to update bgp_original based on bpg_path_info */
|
/* Macro to update bgp_original based on bpg_path_info */
|
||||||
#define BGP_ORIGINAL_UPDATE(_bgp_orig, _mpinfo, _bgp) \
|
#define BGP_ORIGINAL_UPDATE(_bgp_orig, _mpinfo, _bgp) \
|
||||||
((_mpinfo->extra && _mpinfo->extra->vrfleak && \
|
((_mpinfo->extra && _mpinfo->extra->vrfleak && \
|
||||||
|
|
21
bgpd/bgpd.c
21
bgpd/bgpd.c
|
@ -121,7 +121,7 @@ unsigned int bgp_suppress_fib_count;
|
||||||
static void bgp_if_finish(struct bgp *bgp);
|
static void bgp_if_finish(struct bgp *bgp);
|
||||||
static void peer_drop_dynamic_neighbor(struct peer *peer);
|
static void peer_drop_dynamic_neighbor(struct peer *peer);
|
||||||
|
|
||||||
extern struct zclient *zclient;
|
extern struct zclient *bgp_zclient;
|
||||||
|
|
||||||
/* handle main socket creation or deletion */
|
/* handle main socket creation or deletion */
|
||||||
static int bgp_check_main_socket(bool create, struct bgp *bgp)
|
static int bgp_check_main_socket(bool create, struct bgp *bgp)
|
||||||
|
@ -447,9 +447,9 @@ void bm_wait_for_fib_set(bool set)
|
||||||
send_msg = true;
|
send_msg = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (send_msg && zclient)
|
if (send_msg && bgp_zclient)
|
||||||
zebra_route_notify_send(ZEBRA_ROUTE_NOTIFY_REQUEST,
|
zebra_route_notify_send(ZEBRA_ROUTE_NOTIFY_REQUEST,
|
||||||
zclient, set);
|
bgp_zclient, set);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If this is configed at a time when peers are already set
|
* If this is configed at a time when peers are already set
|
||||||
|
@ -507,9 +507,9 @@ void bgp_suppress_fib_pending_set(struct bgp *bgp, bool set)
|
||||||
if (BGP_DEBUG(zebra, ZEBRA))
|
if (BGP_DEBUG(zebra, ZEBRA))
|
||||||
zlog_debug("Sending ZEBRA_ROUTE_NOTIFY_REQUEST");
|
zlog_debug("Sending ZEBRA_ROUTE_NOTIFY_REQUEST");
|
||||||
|
|
||||||
if (zclient)
|
if (bgp_zclient)
|
||||||
zebra_route_notify_send(ZEBRA_ROUTE_NOTIFY_REQUEST,
|
zebra_route_notify_send(ZEBRA_ROUTE_NOTIFY_REQUEST,
|
||||||
zclient, set);
|
bgp_zclient, set);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -3928,16 +3928,16 @@ static void bgp_zclient_set_redist(afi_t afi, int type, unsigned short instance,
|
||||||
{
|
{
|
||||||
if (instance) {
|
if (instance) {
|
||||||
if (set)
|
if (set)
|
||||||
redist_add_instance(&zclient->mi_redist[afi][type],
|
redist_add_instance(&bgp_zclient->mi_redist[afi][type],
|
||||||
instance);
|
instance);
|
||||||
else
|
else
|
||||||
redist_del_instance(&zclient->mi_redist[afi][type],
|
redist_del_instance(&bgp_zclient->mi_redist[afi][type],
|
||||||
instance);
|
instance);
|
||||||
} else {
|
} else {
|
||||||
if (set)
|
if (set)
|
||||||
vrf_bitmap_set(&zclient->redist[afi][type], vrf_id);
|
vrf_bitmap_set(&bgp_zclient->redist[afi][type], vrf_id);
|
||||||
else
|
else
|
||||||
vrf_bitmap_unset(&zclient->redist[afi][type], vrf_id);
|
vrf_bitmap_unset(&bgp_zclient->redist[afi][type], vrf_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4289,8 +4289,7 @@ int bgp_delete(struct bgp *bgp)
|
||||||
FOREACH_AFI_SAFI (afi, safi) {
|
FOREACH_AFI_SAFI (afi, safi) {
|
||||||
struct bgp_aggregate *aggregate = NULL;
|
struct bgp_aggregate *aggregate = NULL;
|
||||||
|
|
||||||
for (struct bgp_dest *dest =
|
for (dest = bgp_table_top(bgp->aggregate[afi][safi]);
|
||||||
bgp_table_top(bgp->aggregate[afi][safi]);
|
|
||||||
dest; dest = bgp_route_next(dest)) {
|
dest; dest = bgp_route_next(dest)) {
|
||||||
aggregate = bgp_dest_get_bgp_aggregate_info(dest);
|
aggregate = bgp_dest_get_bgp_aggregate_info(dest);
|
||||||
if (aggregate == NULL)
|
if (aggregate == NULL)
|
||||||
|
|
|
@ -1352,11 +1352,11 @@ rfapiRouteInfo2NextHopEntry(struct rfapi_ip_prefix *rprefix,
|
||||||
|
|
||||||
bgp_attr_extcom_tunnel_type(bpi->attr, &tun_type);
|
bgp_attr_extcom_tunnel_type(bpi->attr, &tun_type);
|
||||||
if (tun_type == BGP_ENCAP_TYPE_MPLS) {
|
if (tun_type == BGP_ENCAP_TYPE_MPLS) {
|
||||||
struct prefix p;
|
struct prefix pfx;
|
||||||
/* MPLS carries UN address in next hop */
|
/* MPLS carries UN address in next hop */
|
||||||
rfapiNexthop2Prefix(bpi->attr, &p);
|
rfapiNexthop2Prefix(bpi->attr, &pfx);
|
||||||
if (p.family != AF_UNSPEC) {
|
if (pfx.family != AF_UNSPEC) {
|
||||||
rfapiQprefix2Raddr(&p, &new->un_address);
|
rfapiQprefix2Raddr(&pfx, &new->un_address);
|
||||||
have_vnc_tunnel_un = 1;
|
have_vnc_tunnel_un = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1773,7 +1773,7 @@ struct rfapi_next_hop_entry *rfapiRouteNode2NextHopList(
|
||||||
* Add non-withdrawn routes from less-specific prefix
|
* Add non-withdrawn routes from less-specific prefix
|
||||||
*/
|
*/
|
||||||
if (parent) {
|
if (parent) {
|
||||||
const struct prefix *p = agg_node_get_prefix(parent);
|
p = agg_node_get_prefix(parent);
|
||||||
|
|
||||||
rib_rn = rfd_rib_table ? agg_node_get(rfd_rib_table, p) : NULL;
|
rib_rn = rfd_rib_table ? agg_node_get(rfd_rib_table, p) : NULL;
|
||||||
rfapiQprefix2Rprefix(p, &rprefix);
|
rfapiQprefix2Rprefix(p, &rprefix);
|
||||||
|
@ -3224,7 +3224,7 @@ static void rfapiBgpInfoFilteredImportEncap(
|
||||||
__func__, rn);
|
__func__, rn);
|
||||||
#endif
|
#endif
|
||||||
for (m = RFAPI_MONITOR_ENCAP(rn); m; m = m->next) {
|
for (m = RFAPI_MONITOR_ENCAP(rn); m; m = m->next) {
|
||||||
const struct prefix *p;
|
const struct prefix *pfx;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For each referenced bpi/route, copy the ENCAP route's
|
* For each referenced bpi/route, copy the ENCAP route's
|
||||||
|
@ -3252,9 +3252,9 @@ static void rfapiBgpInfoFilteredImportEncap(
|
||||||
* list
|
* list
|
||||||
* per prefix.
|
* per prefix.
|
||||||
*/
|
*/
|
||||||
p = agg_node_get_prefix(m->node);
|
pfx = agg_node_get_prefix(m->node);
|
||||||
referenced_vpn_prefix =
|
referenced_vpn_prefix =
|
||||||
agg_node_get(referenced_vpn_table, p);
|
agg_node_get(referenced_vpn_table, pfx);
|
||||||
assert(referenced_vpn_prefix);
|
assert(referenced_vpn_prefix);
|
||||||
for (mnext = referenced_vpn_prefix->info; mnext;
|
for (mnext = referenced_vpn_prefix->info; mnext;
|
||||||
mnext = mnext->next) {
|
mnext = mnext->next) {
|
||||||
|
|
|
@ -338,13 +338,12 @@ static int process_unicast_route(struct bgp *bgp, /* in */
|
||||||
hattr = *attr;
|
hattr = *attr;
|
||||||
|
|
||||||
if (rmap) {
|
if (rmap) {
|
||||||
struct bgp_path_info info;
|
struct bgp_path_info pinfo = {};
|
||||||
route_map_result_t ret;
|
route_map_result_t ret;
|
||||||
|
|
||||||
memset(&info, 0, sizeof(info));
|
pinfo.peer = peer;
|
||||||
info.peer = peer;
|
pinfo.attr = &hattr;
|
||||||
info.attr = &hattr;
|
ret = route_map_apply(rmap, prefix, &pinfo);
|
||||||
ret = route_map_apply(rmap, prefix, &info);
|
|
||||||
if (ret == RMAP_DENYMATCH) {
|
if (ret == RMAP_DENYMATCH) {
|
||||||
bgp_attr_flush(&hattr);
|
bgp_attr_flush(&hattr);
|
||||||
vnc_zlog_debug_verbose(
|
vnc_zlog_debug_verbose(
|
||||||
|
@ -768,13 +767,12 @@ static void vnc_import_bgp_add_route_mode_plain(struct bgp *bgp,
|
||||||
hattr = *attr;
|
hattr = *attr;
|
||||||
|
|
||||||
if (rmap) {
|
if (rmap) {
|
||||||
struct bgp_path_info info;
|
struct bgp_path_info pinfo = {};
|
||||||
route_map_result_t ret;
|
route_map_result_t ret;
|
||||||
|
|
||||||
memset(&info, 0, sizeof(info));
|
pinfo.peer = peer;
|
||||||
info.peer = peer;
|
pinfo.attr = &hattr;
|
||||||
info.attr = &hattr;
|
ret = route_map_apply(rmap, prefix, &pinfo);
|
||||||
ret = route_map_apply(rmap, prefix, &info);
|
|
||||||
if (ret == RMAP_DENYMATCH) {
|
if (ret == RMAP_DENYMATCH) {
|
||||||
bgp_attr_flush(&hattr);
|
bgp_attr_flush(&hattr);
|
||||||
vnc_zlog_debug_verbose(
|
vnc_zlog_debug_verbose(
|
||||||
|
|
Loading…
Reference in a new issue