mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-24 22:05:40 +00:00
Merge branch 'master' into type5-with-asymm
This commit is contained in:
commit
efc812a379
@ -385,8 +385,8 @@ int bgp_dump_attr(struct attr *attr, char *buf, size_t size)
|
||||
|
||||
if (CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES)))
|
||||
snprintf(buf + strlen(buf), size - strlen(buf),
|
||||
", community %s", community_str(attr->community,
|
||||
false));
|
||||
", community %s",
|
||||
community_str(attr->community, false));
|
||||
|
||||
if (CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES)))
|
||||
snprintf(buf + strlen(buf), size - strlen(buf),
|
||||
|
@ -153,9 +153,9 @@ extern int bgp_debug_zebra(struct prefix *p);
|
||||
|
||||
extern int bgp_debug_count(void);
|
||||
extern const char *bgp_debug_rdpfxpath2str(afi_t, safi_t, struct prefix_rd *,
|
||||
union prefixconstptr,
|
||||
mpls_label_t *, u_int32_t,
|
||||
int, u_int32_t, char *, int);
|
||||
union prefixconstptr, mpls_label_t *,
|
||||
u_int32_t, int, u_int32_t, char *,
|
||||
int);
|
||||
const char *bgp_notify_admin_message(char *buf, size_t bufsz, u_char *data,
|
||||
size_t datalen);
|
||||
|
||||
|
@ -366,8 +366,8 @@ int bgp_show_mpls_vpn(struct vty *vty, afi_t afi, struct prefix_rd *prd,
|
||||
return CMD_WARNING;
|
||||
}
|
||||
table = bgp->rib[afi][SAFI_MPLS_VPN];
|
||||
return bgp_show_table_rd(vty, bgp, SAFI_MPLS_VPN,
|
||||
table, prd, type, output_arg, use_json);
|
||||
return bgp_show_table_rd(vty, bgp, SAFI_MPLS_VPN, table, prd, type,
|
||||
output_arg, use_json);
|
||||
}
|
||||
|
||||
DEFUN (show_bgp_ip_vpn_all_rd,
|
||||
|
462
bgpd/bgp_route.c
462
bgpd/bgp_route.c
File diff suppressed because it is too large
Load Diff
@ -618,8 +618,7 @@ static route_map_result_t route_match_mac_address(void *rule,
|
||||
p.prefixlen = ETH_ALEN * 8;
|
||||
p.u.prefix_eth = prefix->u.prefix_evpn.mac;
|
||||
|
||||
return (access_list_apply(alist, &p)
|
||||
== FILTER_DENY
|
||||
return (access_list_apply(alist, &p) == FILTER_DENY
|
||||
? RMAP_NOMATCH
|
||||
: RMAP_MATCH);
|
||||
}
|
||||
@ -3860,7 +3859,8 @@ DEFUN (set_community,
|
||||
buffer_putstr(b, "no-export");
|
||||
continue;
|
||||
}
|
||||
if (strncmp(argv[i]->arg, "graceful-shutdown", strlen(argv[i]->arg))
|
||||
if (strncmp(argv[i]->arg, "graceful-shutdown",
|
||||
strlen(argv[i]->arg))
|
||||
== 0) {
|
||||
buffer_putstr(b, "graceful-shutdown");
|
||||
continue;
|
||||
|
132
bgpd/bgp_vty.c
132
bgpd/bgp_vty.c
@ -1540,7 +1540,8 @@ DEFUN (no_bgp_maxpaths,
|
||||
}
|
||||
|
||||
ALIAS_HIDDEN(no_bgp_maxpaths, no_bgp_maxpaths_hidden_cmd,
|
||||
"no maximum-paths [" CMD_RANGE_STR(1, MULTIPATH_NUM) "]", NO_STR
|
||||
"no maximum-paths [" CMD_RANGE_STR(1, MULTIPATH_NUM) "]",
|
||||
NO_STR
|
||||
"Forward packets over multiple paths\n"
|
||||
"Number of paths\n")
|
||||
|
||||
@ -4363,22 +4364,22 @@ DEFUN (neighbor_attr_unchanged,
|
||||
SET_FLAG(flags, PEER_FLAG_NEXTHOP_UNCHANGED);
|
||||
SET_FLAG(flags, PEER_FLAG_MED_UNCHANGED);
|
||||
} else {
|
||||
if (!CHECK_FLAG(flags, PEER_FLAG_AS_PATH_UNCHANGED) &&
|
||||
peer_af_flag_check(peer, afi, safi,
|
||||
if (!CHECK_FLAG(flags, PEER_FLAG_AS_PATH_UNCHANGED)
|
||||
&& peer_af_flag_check(peer, afi, safi,
|
||||
PEER_FLAG_AS_PATH_UNCHANGED)) {
|
||||
peer_af_flag_unset_vty(vty, peer_str, afi, safi,
|
||||
PEER_FLAG_AS_PATH_UNCHANGED);
|
||||
}
|
||||
|
||||
if (!CHECK_FLAG(flags, PEER_FLAG_NEXTHOP_UNCHANGED) &&
|
||||
peer_af_flag_check(peer, afi, safi,
|
||||
if (!CHECK_FLAG(flags, PEER_FLAG_NEXTHOP_UNCHANGED)
|
||||
&& peer_af_flag_check(peer, afi, safi,
|
||||
PEER_FLAG_NEXTHOP_UNCHANGED)) {
|
||||
peer_af_flag_unset_vty(vty, peer_str, afi, safi,
|
||||
PEER_FLAG_NEXTHOP_UNCHANGED);
|
||||
}
|
||||
|
||||
if (!CHECK_FLAG(flags, PEER_FLAG_MED_UNCHANGED) &&
|
||||
peer_af_flag_check(peer, afi, safi,
|
||||
if (!CHECK_FLAG(flags, PEER_FLAG_MED_UNCHANGED)
|
||||
&& peer_af_flag_check(peer, afi, safi,
|
||||
PEER_FLAG_MED_UNCHANGED)) {
|
||||
peer_af_flag_unset_vty(vty, peer_str, afi, safi,
|
||||
PEER_FLAG_MED_UNCHANGED);
|
||||
@ -6125,8 +6126,8 @@ DEFUN_NOSH (address_family_ipv4_safi,
|
||||
if (argc == 3) {
|
||||
VTY_DECLVAR_CONTEXT(bgp, bgp);
|
||||
safi_t safi = bgp_vty_safi_from_str(argv[2]->text);
|
||||
if (bgp->inst_type != BGP_INSTANCE_TYPE_DEFAULT &&
|
||||
safi != SAFI_UNICAST && safi != SAFI_MULTICAST
|
||||
if (bgp->inst_type != BGP_INSTANCE_TYPE_DEFAULT
|
||||
&& safi != SAFI_UNICAST && safi != SAFI_MULTICAST
|
||||
&& safi != SAFI_EVPN) {
|
||||
vty_out(vty,
|
||||
"Only Unicast/Multicast/EVPN SAFIs supported in non-core instances.\n");
|
||||
@ -6149,8 +6150,8 @@ DEFUN_NOSH (address_family_ipv6_safi,
|
||||
if (argc == 3) {
|
||||
VTY_DECLVAR_CONTEXT(bgp, bgp);
|
||||
safi_t safi = bgp_vty_safi_from_str(argv[2]->text);
|
||||
if (bgp->inst_type != BGP_INSTANCE_TYPE_DEFAULT &&
|
||||
safi != SAFI_UNICAST && safi != SAFI_MULTICAST
|
||||
if (bgp->inst_type != BGP_INSTANCE_TYPE_DEFAULT
|
||||
&& safi != SAFI_UNICAST && safi != SAFI_MULTICAST
|
||||
&& safi != SAFI_EVPN) {
|
||||
vty_out(vty,
|
||||
"Only Unicast/Multicast/EVPN SAFIs supported in non-core instances.\n");
|
||||
@ -6537,8 +6538,9 @@ DEFUN (show_bgp_vrfs,
|
||||
|
||||
|
||||
if (uj) {
|
||||
int64_t vrf_id_ui = (bgp->vrf_id == VRF_UNKNOWN) ? -1 :
|
||||
(int64_t)bgp->vrf_id;
|
||||
int64_t vrf_id_ui = (bgp->vrf_id == VRF_UNKNOWN)
|
||||
? -1
|
||||
: (int64_t)bgp->vrf_id;
|
||||
json_object_string_add(json_vrf, "type", type);
|
||||
json_object_int_add(json_vrf, "vrfId", vrf_id_ui);
|
||||
json_object_string_add(json_vrf, "routerId",
|
||||
@ -6549,17 +6551,18 @@ DEFUN (show_bgp_vrfs,
|
||||
peers_estb);
|
||||
|
||||
json_object_int_add(json_vrf, "l3vni", bgp->l3vni);
|
||||
json_object_string_add(json_vrf, "rmac",
|
||||
prefix_mac2str(&bgp->rmac, buf,
|
||||
sizeof(buf)));
|
||||
json_object_string_add(
|
||||
json_vrf, "rmac",
|
||||
prefix_mac2str(&bgp->rmac, buf, sizeof(buf)));
|
||||
json_object_object_add(json_vrfs, name, json_vrf);
|
||||
} else
|
||||
vty_out(vty,
|
||||
"%4s %-5d %-16s %9u %10u %-37s %-10u %-15s\n",
|
||||
type, bgp->vrf_id == VRF_UNKNOWN ?
|
||||
-1 : (int)bgp->vrf_id,
|
||||
inet_ntoa(bgp->router_id),
|
||||
peers_cfg, peers_estb, name, bgp->l3vni,
|
||||
type,
|
||||
bgp->vrf_id == VRF_UNKNOWN ? -1
|
||||
: (int)bgp->vrf_id,
|
||||
inet_ntoa(bgp->router_id), peers_cfg,
|
||||
peers_estb, name, bgp->l3vni,
|
||||
prefix_mac2str(&bgp->rmac, buf, sizeof(buf)));
|
||||
}
|
||||
|
||||
@ -6568,7 +6571,8 @@ DEFUN (show_bgp_vrfs,
|
||||
|
||||
json_object_int_add(json, "totalVrfs", count);
|
||||
|
||||
vty_out(vty, "%s\n", json_object_to_json_string_ext(
|
||||
vty_out(vty, "%s\n",
|
||||
json_object_to_json_string_ext(
|
||||
json, JSON_C_TO_STRING_PRETTY));
|
||||
json_object_free(json);
|
||||
} else {
|
||||
@ -6718,16 +6722,19 @@ DEFUN (show_bgp_memory,
|
||||
/* Other attributes */
|
||||
if ((count = community_count()))
|
||||
vty_out(vty, "%ld BGP community entries, using %s of memory\n",
|
||||
count, mtype_memstr(memstrbuf, sizeof(memstrbuf),
|
||||
count,
|
||||
mtype_memstr(memstrbuf, sizeof(memstrbuf),
|
||||
count * sizeof(struct community)));
|
||||
if ((count = mtype_stats_alloc(MTYPE_ECOMMUNITY)))
|
||||
vty_out(vty, "%ld BGP community entries, using %s of memory\n",
|
||||
count, mtype_memstr(memstrbuf, sizeof(memstrbuf),
|
||||
count,
|
||||
mtype_memstr(memstrbuf, sizeof(memstrbuf),
|
||||
count * sizeof(struct ecommunity)));
|
||||
if ((count = mtype_stats_alloc(MTYPE_LCOMMUNITY)))
|
||||
vty_out(vty,
|
||||
"%ld BGP large-community entries, using %s of memory\n",
|
||||
count, mtype_memstr(memstrbuf, sizeof(memstrbuf),
|
||||
count,
|
||||
mtype_memstr(memstrbuf, sizeof(memstrbuf),
|
||||
count * sizeof(struct lcommunity)));
|
||||
|
||||
if ((count = mtype_stats_alloc(MTYPE_CLUSTER)))
|
||||
@ -6757,7 +6764,8 @@ DEFUN (show_bgp_memory,
|
||||
count * sizeof(struct hash_backet)));
|
||||
if ((count = mtype_stats_alloc(MTYPE_BGP_REGEXP)))
|
||||
vty_out(vty, "%ld compiled regexes, using %s of memory\n",
|
||||
count, mtype_memstr(memstrbuf, sizeof(memstrbuf),
|
||||
count,
|
||||
mtype_memstr(memstrbuf, sizeof(memstrbuf),
|
||||
count * sizeof(regex_t)));
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
@ -6773,27 +6781,21 @@ static void bgp_show_bestpath_json(struct bgp *bgp, json_object *json)
|
||||
json_object_string_add(bestpath, "asPath", "confed");
|
||||
|
||||
if (bgp_flag_check(bgp, BGP_FLAG_ASPATH_MULTIPATH_RELAX)) {
|
||||
if (bgp_flag_check(bgp,
|
||||
BGP_FLAG_MULTIPATH_RELAX_AS_SET))
|
||||
json_object_string_add(bestpath,
|
||||
"multiPathRelax",
|
||||
if (bgp_flag_check(bgp, BGP_FLAG_MULTIPATH_RELAX_AS_SET))
|
||||
json_object_string_add(bestpath, "multiPathRelax",
|
||||
"as-set");
|
||||
else
|
||||
json_object_string_add(bestpath,
|
||||
"multiPathRelax",
|
||||
json_object_string_add(bestpath, "multiPathRelax",
|
||||
"true");
|
||||
} else
|
||||
json_object_string_add(bestpath,
|
||||
"multiPathRelax",
|
||||
"false");
|
||||
json_object_string_add(bestpath, "multiPathRelax", "false");
|
||||
|
||||
if (bgp_flag_check(bgp, BGP_FLAG_COMPARE_ROUTER_ID))
|
||||
json_object_string_add(bestpath, "compareRouterId", "true");
|
||||
if (bgp_flag_check(bgp, BGP_FLAG_MED_CONFED)
|
||||
|| bgp_flag_check(bgp, BGP_FLAG_MED_MISSING_AS_WORST)) {
|
||||
if (bgp_flag_check(bgp, BGP_FLAG_MED_CONFED))
|
||||
json_object_string_add(bestpath, "med",
|
||||
"confed");
|
||||
json_object_string_add(bestpath, "med", "confed");
|
||||
if (bgp_flag_check(bgp, BGP_FLAG_MED_MISSING_AS_WORST))
|
||||
json_object_string_add(bestpath, "med",
|
||||
"missing-as-worst");
|
||||
@ -6884,9 +6886,9 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
|
||||
char memstrbuf[MTYPE_MEMSTR_LEN];
|
||||
int64_t vrf_id_ui;
|
||||
|
||||
vrf_id_ui =
|
||||
(bgp->vrf_id == VRF_UNKNOWN) ? -1 :
|
||||
(int64_t)bgp->vrf_id;
|
||||
vrf_id_ui = (bgp->vrf_id == VRF_UNKNOWN)
|
||||
? -1
|
||||
: (int64_t)bgp->vrf_id;
|
||||
|
||||
/* Usage summary and header */
|
||||
if (use_json) {
|
||||
@ -6905,8 +6907,9 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
|
||||
vty_out(vty,
|
||||
"BGP router identifier %s, local AS number %u vrf-id %d",
|
||||
inet_ntoa(bgp->router_id), bgp->as,
|
||||
bgp->vrf_id == VRF_UNKNOWN ? -1 :
|
||||
(int)bgp->vrf_id);
|
||||
bgp->vrf_id == VRF_UNKNOWN
|
||||
? -1
|
||||
: (int)bgp->vrf_id);
|
||||
vty_out(vty, "\n");
|
||||
}
|
||||
|
||||
@ -7015,7 +7018,8 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
|
||||
json, "peerGroupCount", ents);
|
||||
json_object_int_add(
|
||||
json, "peerGroupMemory",
|
||||
ents * sizeof(struct
|
||||
ents
|
||||
* sizeof(struct
|
||||
peer_group));
|
||||
}
|
||||
|
||||
@ -7039,9 +7043,10 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
|
||||
vty_out(vty,
|
||||
"RIB entries %ld, using %s of memory\n",
|
||||
ents,
|
||||
mtype_memstr(memstrbuf,
|
||||
sizeof(memstrbuf),
|
||||
ents * sizeof(struct
|
||||
mtype_memstr(
|
||||
memstrbuf, sizeof(memstrbuf),
|
||||
ents
|
||||
* sizeof(struct
|
||||
bgp_node)));
|
||||
|
||||
/* Peer related usage */
|
||||
@ -7059,7 +7064,8 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
|
||||
mtype_memstr(
|
||||
memstrbuf,
|
||||
sizeof(memstrbuf),
|
||||
ents * sizeof(struct
|
||||
ents
|
||||
* sizeof(struct
|
||||
peer_group)));
|
||||
|
||||
if (CHECK_FLAG(bgp->af_flags[afi][safi],
|
||||
@ -7165,7 +7171,8 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
|
||||
if (peer->status == Established)
|
||||
if (peer->afc_recv[afi][pfx_rcd_safi])
|
||||
vty_out(vty, " %12ld",
|
||||
peer->pcount[afi][pfx_rcd_safi]);
|
||||
peer->pcount[afi]
|
||||
[pfx_rcd_safi]);
|
||||
else
|
||||
vty_out(vty, " NoNeg");
|
||||
else {
|
||||
@ -7192,7 +7199,8 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
|
||||
|
||||
bgp_show_bestpath_json(bgp, json);
|
||||
|
||||
vty_out(vty, "%s\n", json_object_to_json_string_ext(
|
||||
vty_out(vty, "%s\n",
|
||||
json_object_to_json_string_ext(
|
||||
json, JSON_C_TO_STRING_PRETTY));
|
||||
json_object_free(json);
|
||||
} else {
|
||||
@ -7829,8 +7837,9 @@ static void bgp_show_peer_afi(struct vty *vty, struct peer *p, afi_t afi,
|
||||
|
||||
paf = peer_af_find(p, afi, safi);
|
||||
if (paf && PAF_SUBGRP(paf)) {
|
||||
vty_out(vty, " Update group %" PRIu64
|
||||
", subgroup %" PRIu64 "\n",
|
||||
vty_out(vty,
|
||||
" Update group %" PRIu64 ", subgroup %" PRIu64
|
||||
"\n",
|
||||
PAF_UPDGRP(paf)->id, PAF_SUBGRP(paf)->id);
|
||||
vty_out(vty, " Packet Queue length %d\n",
|
||||
bpacket_queue_virtual_length(paf));
|
||||
@ -8300,7 +8309,8 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, u_char use_json,
|
||||
epoch_tbuf = time(NULL) - uptime;
|
||||
|
||||
#if CONFDATE > 20200101
|
||||
CPP_NOTICE("bgpTimerUp should be deprecated and can be removed now");
|
||||
CPP_NOTICE(
|
||||
"bgpTimerUp should be deprecated and can be removed now");
|
||||
#endif
|
||||
/*
|
||||
* bgpTimerUp was miliseconds that was accurate
|
||||
@ -8376,8 +8386,8 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, u_char use_json,
|
||||
"bgpTimerConfiguredKeepAliveIntervalMsecs",
|
||||
p->keepalive * 1000);
|
||||
} else if ((bgp->default_holdtime != BGP_DEFAULT_HOLDTIME)
|
||||
|| (bgp->default_keepalive !=
|
||||
BGP_DEFAULT_KEEPALIVE)) {
|
||||
|| (bgp->default_keepalive
|
||||
!= BGP_DEFAULT_KEEPALIVE)) {
|
||||
json_object_int_add(json_neigh,
|
||||
"bgpTimerConfiguredHoldTimeMsecs",
|
||||
bgp->default_holdtime);
|
||||
@ -8437,8 +8447,8 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, u_char use_json,
|
||||
vty_out(vty, ", keepalive interval is %d seconds\n",
|
||||
p->keepalive);
|
||||
} else if ((bgp->default_holdtime != BGP_DEFAULT_HOLDTIME)
|
||||
|| (bgp->default_keepalive !=
|
||||
BGP_DEFAULT_KEEPALIVE)) {
|
||||
|| (bgp->default_keepalive
|
||||
!= BGP_DEFAULT_KEEPALIVE)) {
|
||||
vty_out(vty, " Configured hold time is %d",
|
||||
bgp->default_holdtime);
|
||||
vty_out(vty, ", keepalive interval is %d seconds\n",
|
||||
@ -9629,7 +9639,8 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, u_char use_json,
|
||||
} else
|
||||
vty_out(vty,
|
||||
" Reduce the no. of prefix from %s, will restart in %ld seconds\n",
|
||||
p->host, thread_timer_remain_second(
|
||||
p->host,
|
||||
thread_timer_remain_second(
|
||||
p->t_pmax_restart));
|
||||
} else {
|
||||
if (use_json)
|
||||
@ -9874,7 +9885,8 @@ static int bgp_show_neighbor(struct vty *vty, struct bgp *bgp,
|
||||
}
|
||||
|
||||
if (use_json) {
|
||||
vty_out(vty, "%s\n", json_object_to_json_string_ext(
|
||||
vty_out(vty, "%s\n",
|
||||
json_object_to_json_string_ext(
|
||||
json, JSON_C_TO_STRING_PRETTY));
|
||||
json_object_free(json);
|
||||
} else {
|
||||
@ -9910,7 +9922,8 @@ static void bgp_show_all_instances_neighbors_vty(struct vty *vty,
|
||||
|
||||
json_object_int_add(json, "vrfId",
|
||||
(bgp->vrf_id == VRF_UNKNOWN)
|
||||
? -1 : (int64_t) bgp->vrf_id);
|
||||
? -1
|
||||
: (int64_t)bgp->vrf_id);
|
||||
json_object_string_add(
|
||||
json, "vrfName",
|
||||
(bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT)
|
||||
@ -10645,7 +10658,8 @@ DEFUN (show_ip_bgp_peer_groups,
|
||||
vrf = pg = NULL;
|
||||
int idx = 0;
|
||||
|
||||
vrf = argv_find(argv, argc, "VIEWVRFNAME", &idx) ? argv[idx]->arg : NULL;
|
||||
vrf = argv_find(argv, argc, "VIEWVRFNAME", &idx) ? argv[idx]->arg
|
||||
: NULL;
|
||||
pg = argv_find(argv, argc, "PGNAME", &idx) ? argv[idx]->arg : NULL;
|
||||
|
||||
return bgp_show_peer_group_vty(vty, vrf, pg);
|
||||
|
@ -570,8 +570,8 @@ static int zebra_read_route(int command, struct zclient *zclient,
|
||||
|
||||
/* Now perform the add/update. */
|
||||
bgp_redistribute_add(bgp, &api.prefix, &nexthop, ifindex,
|
||||
nhtype, api.metric, api.type,
|
||||
api.instance, api.tag);
|
||||
nhtype, api.metric, api.type, api.instance,
|
||||
api.tag);
|
||||
} else {
|
||||
bgp_redistribute_delete(bgp, &api.prefix, api.type,
|
||||
api.instance);
|
||||
@ -1142,8 +1142,8 @@ void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p,
|
||||
api_nh->type = NEXTHOP_TYPE_IPV6_IFINDEX;
|
||||
}
|
||||
|
||||
if (mpinfo->extra &&
|
||||
bgp_is_valid_label(&mpinfo->extra->label[0])
|
||||
if (mpinfo->extra
|
||||
&& bgp_is_valid_label(&mpinfo->extra->label[0])
|
||||
&& !CHECK_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE)) {
|
||||
has_valid_label = 1;
|
||||
label = label_pton(&mpinfo->extra->label[0]);
|
||||
@ -1155,8 +1155,7 @@ void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p,
|
||||
}
|
||||
|
||||
/* if this is a evpn route we don't have to include the label */
|
||||
if (has_valid_label &&
|
||||
!(CHECK_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE)))
|
||||
if (has_valid_label && !(CHECK_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE)))
|
||||
SET_FLAG(api.message, ZAPI_MESSAGE_LABEL);
|
||||
|
||||
if (info->sub_type != BGP_ROUTE_AGGREGATE)
|
||||
@ -1198,8 +1197,8 @@ void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p,
|
||||
sizeof(nh_buf));
|
||||
|
||||
label_buf[0] = '\0';
|
||||
if (has_valid_label &&
|
||||
!CHECK_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE))
|
||||
if (has_valid_label
|
||||
&& !CHECK_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE))
|
||||
sprintf(label_buf, "label %u",
|
||||
api_nh->labels[0]);
|
||||
zlog_debug(" nhop [%d]: %s %s", i + 1, nh_buf,
|
||||
@ -1579,8 +1578,7 @@ void bgp_zebra_instance_register(struct bgp *bgp)
|
||||
|
||||
/* For default instance, register to learn about VNIs, if appropriate.
|
||||
*/
|
||||
if (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT
|
||||
&& is_evpn_enabled())
|
||||
if (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT && is_evpn_enabled())
|
||||
bgp_zebra_advertise_all_vni(bgp, 1);
|
||||
}
|
||||
|
||||
@ -1598,8 +1596,7 @@ void bgp_zebra_instance_deregister(struct bgp *bgp)
|
||||
|
||||
/* For default instance, unregister learning about VNIs, if appropriate.
|
||||
*/
|
||||
if (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT
|
||||
&& is_evpn_enabled())
|
||||
if (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT && is_evpn_enabled())
|
||||
bgp_zebra_advertise_all_vni(bgp, 0);
|
||||
|
||||
/* Deregister for router-id, interfaces, redistributed routes. */
|
||||
@ -1788,8 +1785,8 @@ static int bgp_zebra_process_local_vni(int command, struct zclient *zclient,
|
||||
if (BGP_DEBUG(zebra, ZEBRA))
|
||||
zlog_debug("Rx VNI %s VRF %s VNI %u tenant-vrf %s",
|
||||
(command == ZEBRA_VNI_ADD) ? "add" : "del",
|
||||
vrf_id_to_name(vrf_id),
|
||||
vni, vrf_id_to_name(tenant_vrf_id));
|
||||
vrf_id_to_name(vrf_id), vni,
|
||||
vrf_id_to_name(tenant_vrf_id));
|
||||
|
||||
if (command == ZEBRA_VNI_ADD)
|
||||
return bgp_evpn_local_vni_add(
|
||||
@ -1848,8 +1845,7 @@ static int bgp_zebra_process_local_macip(int command, struct zclient *zclient,
|
||||
return bgp_evpn_local_macip_del(bgp, vni, &mac, &ip);
|
||||
}
|
||||
|
||||
static void bgp_zebra_process_local_ip_prefix(int cmd,
|
||||
struct zclient *zclient,
|
||||
static void bgp_zebra_process_local_ip_prefix(int cmd, struct zclient *zclient,
|
||||
zebra_size_t length,
|
||||
vrf_id_t vrf_id)
|
||||
{
|
||||
@ -1875,25 +1871,19 @@ static void bgp_zebra_process_local_ip_prefix(int cmd,
|
||||
if (cmd == ZEBRA_IP_PREFIX_ROUTE_ADD) {
|
||||
|
||||
if (p.family == AF_INET)
|
||||
return bgp_evpn_advertise_type5_route(bgp_vrf, &p,
|
||||
NULL,
|
||||
AFI_IP,
|
||||
SAFI_UNICAST);
|
||||
return bgp_evpn_advertise_type5_route(
|
||||
bgp_vrf, &p, NULL, AFI_IP, SAFI_UNICAST);
|
||||
else
|
||||
return bgp_evpn_advertise_type5_route(bgp_vrf, &p,
|
||||
NULL,
|
||||
AFI_IP6,
|
||||
SAFI_UNICAST);
|
||||
return bgp_evpn_advertise_type5_route(
|
||||
bgp_vrf, &p, NULL, AFI_IP6, SAFI_UNICAST);
|
||||
|
||||
} else {
|
||||
if (p.family == AF_INET)
|
||||
return bgp_evpn_withdraw_type5_route(bgp_vrf, &p,
|
||||
AFI_IP,
|
||||
SAFI_UNICAST);
|
||||
return bgp_evpn_withdraw_type5_route(
|
||||
bgp_vrf, &p, AFI_IP, SAFI_UNICAST);
|
||||
else
|
||||
return bgp_evpn_withdraw_type5_route(bgp_vrf, &p,
|
||||
AFI_IP6,
|
||||
SAFI_UNICAST);
|
||||
return bgp_evpn_withdraw_type5_route(
|
||||
bgp_vrf, &p, AFI_IP6, SAFI_UNICAST);
|
||||
}
|
||||
}
|
||||
|
||||
|
73
bgpd/bgpd.c
73
bgpd/bgpd.c
@ -1403,16 +1403,12 @@ static void bgp_recalculate_afi_safi_bestpaths(struct bgp *bgp, afi_t afi,
|
||||
if (rn->info != NULL) {
|
||||
/* Special handling for 2-level routing
|
||||
* tables. */
|
||||
if (safi == SAFI_MPLS_VPN
|
||||
|| safi == SAFI_ENCAP
|
||||
if (safi == SAFI_MPLS_VPN || safi == SAFI_ENCAP
|
||||
|| safi == SAFI_EVPN) {
|
||||
for (nrn = bgp_table_top((
|
||||
struct bgp_table
|
||||
*)(rn->info));
|
||||
nrn;
|
||||
nrn = bgp_route_next(nrn))
|
||||
bgp_process(bgp, nrn,
|
||||
afi, safi);
|
||||
for (nrn = bgp_table_top(
|
||||
(struct bgp_table *)(rn->info));
|
||||
nrn; nrn = bgp_route_next(nrn))
|
||||
bgp_process(bgp, nrn, afi, safi);
|
||||
} else
|
||||
bgp_process(bgp, rn, afi, safi);
|
||||
}
|
||||
@ -1864,8 +1860,7 @@ static int peer_activate_af(struct peer *peer, afi_t afi, safi_t safi)
|
||||
peer->afc[afi][safi] = 1;
|
||||
|
||||
if (peer->group)
|
||||
peer_group2peer_config_copy_af(peer->group, peer,
|
||||
afi, safi);
|
||||
peer_group2peer_config_copy_af(peer->group, peer, afi, safi);
|
||||
|
||||
if (!active && peer_active(peer)) {
|
||||
bgp_timer_set(peer);
|
||||
@ -1933,12 +1928,14 @@ int peer_activate(struct peer *peer, afi_t afi, safi_t safi)
|
||||
ret |= peer_activate_af(peer, afi, safi);
|
||||
}
|
||||
|
||||
/* If this is the first peer to be activated for this afi/labeled-unicast
|
||||
* recalc bestpaths to trigger label allocation */
|
||||
if (safi == SAFI_LABELED_UNICAST && !bgp->allocate_mpls_labels[afi][SAFI_UNICAST]) {
|
||||
/* If this is the first peer to be activated for this
|
||||
* afi/labeled-unicast recalc bestpaths to trigger label allocation */
|
||||
if (safi == SAFI_LABELED_UNICAST
|
||||
&& !bgp->allocate_mpls_labels[afi][SAFI_UNICAST]) {
|
||||
|
||||
if (BGP_DEBUG(zebra, ZEBRA))
|
||||
zlog_info("peer(s) are now active for labeled-unicast, allocate MPLS labels");
|
||||
zlog_info(
|
||||
"peer(s) are now active for labeled-unicast, allocate MPLS labels");
|
||||
|
||||
bgp->allocate_mpls_labels[afi][SAFI_UNICAST] = 1;
|
||||
bgp_recalculate_afi_safi_bestpaths(bgp, afi, SAFI_UNICAST);
|
||||
@ -2027,14 +2024,15 @@ int peer_deactivate(struct peer *peer, afi_t afi, safi_t safi)
|
||||
|
||||
bgp = peer->bgp;
|
||||
|
||||
/* If this is the last peer to be deactivated for this afi/labeled-unicast
|
||||
* recalc bestpaths to trigger label deallocation */
|
||||
if (safi == SAFI_LABELED_UNICAST &&
|
||||
bgp->allocate_mpls_labels[afi][SAFI_UNICAST] &&
|
||||
!bgp_afi_safi_peer_exists(bgp, afi, safi)) {
|
||||
/* If this is the last peer to be deactivated for this
|
||||
* afi/labeled-unicast recalc bestpaths to trigger label deallocation */
|
||||
if (safi == SAFI_LABELED_UNICAST
|
||||
&& bgp->allocate_mpls_labels[afi][SAFI_UNICAST]
|
||||
&& !bgp_afi_safi_peer_exists(bgp, afi, safi)) {
|
||||
|
||||
if (BGP_DEBUG(zebra, ZEBRA))
|
||||
zlog_info("peer(s) are no longer active for labeled-unicast, deallocate MPLS labels");
|
||||
zlog_info(
|
||||
"peer(s) are no longer active for labeled-unicast, deallocate MPLS labels");
|
||||
|
||||
bgp->allocate_mpls_labels[afi][SAFI_UNICAST] = 0;
|
||||
bgp_recalculate_afi_safi_bestpaths(bgp, afi, SAFI_UNICAST);
|
||||
@ -2856,8 +2854,7 @@ static struct bgp *bgp_create(as_t *as, const char *name,
|
||||
XSTRDUP(MTYPE_BGP_PEER_HOST, cmd_domainname_get());
|
||||
bgp->peer = list_new();
|
||||
bgp->peer->cmp = (int (*)(void *, void *))peer_cmp;
|
||||
bgp->peerhash = hash_create(peer_hash_key_make,
|
||||
peer_hash_same,
|
||||
bgp->peerhash = hash_create(peer_hash_key_make, peer_hash_same,
|
||||
"BGP Peer Hash");
|
||||
bgp->peerhash->max_size = BGP_PEER_MAX_HASH_SIZE;
|
||||
|
||||
@ -3988,7 +3985,8 @@ static int peer_af_flag_modify(struct peer *peer, afi_t afi, safi_t safi,
|
||||
}
|
||||
|
||||
/* Track if addpath TX is in use */
|
||||
if (flag & (PEER_FLAG_ADDPATH_TX_ALL_PATHS
|
||||
if (flag
|
||||
& (PEER_FLAG_ADDPATH_TX_ALL_PATHS
|
||||
| PEER_FLAG_ADDPATH_TX_BESTPATH_PER_AS)) {
|
||||
bgp = peer->bgp;
|
||||
addpath_tx_used = 0;
|
||||
@ -6802,7 +6800,8 @@ static void bgp_config_write_peer_af(struct vty *vty, struct bgp *bgp,
|
||||
} else {
|
||||
if (!peer_af_flag_check(peer, afi, safi,
|
||||
PEER_FLAG_SEND_COMMUNITY)
|
||||
&& (!g_peer || peer_af_flag_check(g_peer, afi, safi,
|
||||
&& (!g_peer
|
||||
|| peer_af_flag_check(g_peer, afi, safi,
|
||||
PEER_FLAG_SEND_COMMUNITY))
|
||||
&& !peer_af_flag_check(peer, afi, safi,
|
||||
PEER_FLAG_SEND_EXT_COMMUNITY)
|
||||
@ -6811,7 +6810,8 @@ static void bgp_config_write_peer_af(struct vty *vty, struct bgp *bgp,
|
||||
PEER_FLAG_SEND_EXT_COMMUNITY))
|
||||
&& !peer_af_flag_check(peer, afi, safi,
|
||||
PEER_FLAG_SEND_LARGE_COMMUNITY)
|
||||
&& (!g_peer || peer_af_flag_check(
|
||||
&& (!g_peer
|
||||
|| peer_af_flag_check(
|
||||
g_peer, afi, safi,
|
||||
PEER_FLAG_SEND_LARGE_COMMUNITY))) {
|
||||
vty_out(vty, " no neighbor %s send-community all\n",
|
||||
@ -6841,7 +6841,8 @@ static void bgp_config_write_peer_af(struct vty *vty, struct bgp *bgp,
|
||||
|
||||
if (!peer_af_flag_check(peer, afi, safi,
|
||||
PEER_FLAG_SEND_COMMUNITY)
|
||||
&& (!g_peer || peer_af_flag_check(
|
||||
&& (!g_peer
|
||||
|| peer_af_flag_check(
|
||||
g_peer, afi, safi,
|
||||
PEER_FLAG_SEND_COMMUNITY))) {
|
||||
vty_out(vty,
|
||||
@ -6954,16 +6955,16 @@ static void bgp_config_write_peer_af(struct vty *vty, struct bgp *bgp,
|
||||
bgp_config_write_filter(vty, peer, afi, safi);
|
||||
|
||||
/* atribute-unchanged. */
|
||||
if (peer_af_flag_check(peer, afi, safi, PEER_FLAG_AS_PATH_UNCHANGED) ||
|
||||
peer_af_flag_check(peer, afi, safi, PEER_FLAG_NEXTHOP_UNCHANGED) ||
|
||||
peer_af_flag_check(peer, afi, safi, PEER_FLAG_MED_UNCHANGED)) {
|
||||
if (peer_af_flag_check(peer, afi, safi, PEER_FLAG_AS_PATH_UNCHANGED)
|
||||
|| peer_af_flag_check(peer, afi, safi, PEER_FLAG_NEXTHOP_UNCHANGED)
|
||||
|| peer_af_flag_check(peer, afi, safi, PEER_FLAG_MED_UNCHANGED)) {
|
||||
|
||||
if (!peer_group_active(peer) ||
|
||||
peergroup_af_flag_check(peer, afi, safi,
|
||||
PEER_FLAG_AS_PATH_UNCHANGED) ||
|
||||
peergroup_af_flag_check(peer, afi, safi,
|
||||
PEER_FLAG_NEXTHOP_UNCHANGED) ||
|
||||
peergroup_af_flag_check(peer, afi, safi,
|
||||
if (!peer_group_active(peer)
|
||||
|| peergroup_af_flag_check(peer, afi, safi,
|
||||
PEER_FLAG_AS_PATH_UNCHANGED)
|
||||
|| peergroup_af_flag_check(peer, afi, safi,
|
||||
PEER_FLAG_NEXTHOP_UNCHANGED)
|
||||
|| peergroup_af_flag_check(peer, afi, safi,
|
||||
PEER_FLAG_MED_UNCHANGED)) {
|
||||
|
||||
vty_out(vty,
|
||||
|
40
bgpd/bgpd.h
40
bgpd/bgpd.h
@ -262,9 +262,10 @@ struct bgp {
|
||||
/* $FRR indent$ */
|
||||
/* clang-format off */
|
||||
#define BGP_MAXMED_ADMIN_UNCONFIGURED 0 /* Off by default */
|
||||
u_int32_t
|
||||
maxmed_admin_value; /* Max-med value when administrative in on
|
||||
u_int32_t maxmed_admin_value; /* Max-med value when administrative in on
|
||||
*/
|
||||
/* $FRR indent$ */
|
||||
/* clang-format off */
|
||||
#define BGP_MAXMED_VALUE_DEFAULT 4294967294 /* Maximum by default */
|
||||
|
||||
u_char maxmed_active; /* 1/0 if max-med is active or not */
|
||||
@ -871,20 +872,28 @@ struct peer {
|
||||
struct work_queue *clear_node_queue;
|
||||
|
||||
#define PEER_TOTAL_RX(peer) \
|
||||
atomic_load_explicit(&peer->open_in, memory_order_relaxed) + \
|
||||
atomic_load_explicit(&peer->update_in, memory_order_relaxed) + \
|
||||
atomic_load_explicit(&peer->notify_in, memory_order_relaxed) + \
|
||||
atomic_load_explicit(&peer->refresh_in, memory_order_relaxed) + \
|
||||
atomic_load_explicit(&peer->keepalive_in, memory_order_relaxed) + \
|
||||
atomic_load_explicit(&peer->dynamic_cap_in, memory_order_relaxed)
|
||||
atomic_load_explicit(&peer->open_in, memory_order_relaxed) \
|
||||
+ atomic_load_explicit(&peer->update_in, memory_order_relaxed) \
|
||||
+ atomic_load_explicit(&peer->notify_in, memory_order_relaxed) \
|
||||
+ atomic_load_explicit(&peer->refresh_in, \
|
||||
memory_order_relaxed) \
|
||||
+ atomic_load_explicit(&peer->keepalive_in, \
|
||||
memory_order_relaxed) \
|
||||
+ atomic_load_explicit(&peer->dynamic_cap_in, \
|
||||
memory_order_relaxed)
|
||||
|
||||
#define PEER_TOTAL_TX(peer) \
|
||||
atomic_load_explicit(&peer->open_out, memory_order_relaxed) + \
|
||||
atomic_load_explicit(&peer->update_out, memory_order_relaxed) + \
|
||||
atomic_load_explicit(&peer->notify_out, memory_order_relaxed) + \
|
||||
atomic_load_explicit(&peer->refresh_out, memory_order_relaxed) + \
|
||||
atomic_load_explicit(&peer->keepalive_out, memory_order_relaxed) + \
|
||||
atomic_load_explicit(&peer->dynamic_cap_out, memory_order_relaxed)
|
||||
atomic_load_explicit(&peer->open_out, memory_order_relaxed) \
|
||||
+ atomic_load_explicit(&peer->update_out, \
|
||||
memory_order_relaxed) \
|
||||
+ atomic_load_explicit(&peer->notify_out, \
|
||||
memory_order_relaxed) \
|
||||
+ atomic_load_explicit(&peer->refresh_out, \
|
||||
memory_order_relaxed) \
|
||||
+ atomic_load_explicit(&peer->keepalive_out, \
|
||||
memory_order_relaxed) \
|
||||
+ atomic_load_explicit(&peer->dynamic_cap_out, \
|
||||
memory_order_relaxed)
|
||||
|
||||
/* Statistics field */
|
||||
_Atomic uint32_t open_in; /* Open message input count */
|
||||
@ -1481,7 +1490,8 @@ extern int peer_cmp(struct peer *p1, struct peer *p2);
|
||||
extern int bgp_map_afi_safi_iana2int(iana_afi_t pkt_afi, iana_safi_t pkt_safi,
|
||||
afi_t *afi, safi_t *safi);
|
||||
extern int bgp_map_afi_safi_int2iana(afi_t afi, safi_t safi,
|
||||
iana_afi_t *pkt_afi, iana_safi_t *pkt_safi);
|
||||
iana_afi_t *pkt_afi,
|
||||
iana_safi_t *pkt_safi);
|
||||
|
||||
extern struct peer_af *peer_af_create(struct peer *, afi_t, safi_t);
|
||||
extern struct peer_af *peer_af_find(struct peer *, afi_t, safi_t);
|
||||
|
@ -264,7 +264,8 @@ int bgp_rfapi_is_vnc_configured(struct bgp *bgp)
|
||||
{ \
|
||||
switch (bgp_rfapi_is_vnc_configured(bgp)) { \
|
||||
case EPERM: \
|
||||
vty_out(vty, "VNC operations only permitted on default BGP instance.\n"); \
|
||||
vty_out(vty, \
|
||||
"VNC operations only permitted on default BGP instance.\n"); \
|
||||
return CMD_WARNING_CONFIG_FAILED; \
|
||||
break; \
|
||||
case ENXIO: \
|
||||
@ -509,8 +510,7 @@ DEFUN (vnc_defaults_responselifetime,
|
||||
} else {
|
||||
rspint = strtoul(argv[1]->arg, NULL, 10);
|
||||
if (rspint > INT32_MAX)
|
||||
rspint =
|
||||
INT32_MAX; /* is really an int, not an unsigned
|
||||
rspint = INT32_MAX; /* is really an int, not an unsigned
|
||||
int */
|
||||
}
|
||||
|
||||
@ -1636,8 +1636,8 @@ DEFUN (vnc_nve_group_export_no_prefixlist,
|
||||
idx += 2; /* skip afi and keyword */
|
||||
|
||||
if (is_bgp) {
|
||||
if (idx == argc ||
|
||||
strmatch(argv[idx]->arg,
|
||||
if (idx == argc
|
||||
|| strmatch(argv[idx]->arg,
|
||||
rfg->plist_export_bgp_name[afi])) {
|
||||
if (rfg->plist_export_bgp_name[afi])
|
||||
free(rfg->plist_export_bgp_name[afi]);
|
||||
@ -1647,8 +1647,8 @@ DEFUN (vnc_nve_group_export_no_prefixlist,
|
||||
vnc_direct_bgp_reexport_group_afi(bgp, rfg, afi);
|
||||
}
|
||||
} else {
|
||||
if (idx == argc ||
|
||||
strmatch(argv[idx]->arg,
|
||||
if (idx == argc
|
||||
|| strmatch(argv[idx]->arg,
|
||||
rfg->plist_export_zebra_name[afi])) {
|
||||
if (rfg->plist_export_zebra_name[afi])
|
||||
free(rfg->plist_export_zebra_name[afi]);
|
||||
@ -1768,8 +1768,9 @@ DEFUN (vnc_nve_group_export_no_routemap,
|
||||
}
|
||||
|
||||
if (is_bgp) {
|
||||
if (idx == argc ||
|
||||
strmatch(argv[idx]->arg, rfg->routemap_export_bgp_name)) {
|
||||
if (idx == argc
|
||||
|| strmatch(argv[idx]->arg,
|
||||
rfg->routemap_export_bgp_name)) {
|
||||
if (rfg->routemap_export_bgp_name)
|
||||
free(rfg->routemap_export_bgp_name);
|
||||
rfg->routemap_export_bgp_name = NULL;
|
||||
@ -1779,8 +1780,8 @@ DEFUN (vnc_nve_group_export_no_routemap,
|
||||
vnc_direct_bgp_reexport_group_afi(bgp, rfg, AFI_IP6);
|
||||
}
|
||||
} else {
|
||||
if (idx == argc ||
|
||||
strmatch(argv[idx]->arg,
|
||||
if (idx == argc
|
||||
|| strmatch(argv[idx]->arg,
|
||||
rfg->routemap_export_zebra_name)) {
|
||||
if (rfg->routemap_export_zebra_name)
|
||||
free(rfg->routemap_export_zebra_name);
|
||||
@ -2466,8 +2467,7 @@ bgp_rfapi_delete_named_nve_group(struct vty *vty, /* NULL = no output */
|
||||
if (rfg->rfd)
|
||||
clear_vnc_vrf_closer(rfg);
|
||||
bgp_rfapi_delete_nve_group(vty, bgp, rfg);
|
||||
}
|
||||
else /* must be delete all */
|
||||
} else /* must be delete all */
|
||||
for (ALL_LIST_ELEMENTS(bgp->rfapi_cfg->nve_groups_sequential,
|
||||
node, nnode, rfg)) {
|
||||
if (rfg->rfd)
|
||||
@ -3950,7 +3950,9 @@ int bgp_rfapi_cfg_write(struct vty *vty, struct bgp *bgp)
|
||||
if (rfg->plist_export_bgp_name[afi]) {
|
||||
vty_out(vty,
|
||||
" export %s%s prefix-list %s\n",
|
||||
(rfg->type == RFAPI_GROUP_CFG_VRF ? "" : "bgp "),
|
||||
(rfg->type == RFAPI_GROUP_CFG_VRF
|
||||
? ""
|
||||
: "bgp "),
|
||||
afistr,
|
||||
rfg->plist_export_bgp_name
|
||||
[afi]);
|
||||
@ -3958,7 +3960,9 @@ int bgp_rfapi_cfg_write(struct vty *vty, struct bgp *bgp)
|
||||
if (rfg->plist_export_zebra_name[afi]) {
|
||||
vty_out(vty,
|
||||
" export %s%s prefix-list %s\n",
|
||||
(rfg->type == RFAPI_GROUP_CFG_VRF ? "" : "zebra "),
|
||||
(rfg->type == RFAPI_GROUP_CFG_VRF
|
||||
? ""
|
||||
: "zebra "),
|
||||
afistr,
|
||||
rfg->plist_export_zebra_name
|
||||
[afi]);
|
||||
@ -3993,12 +3997,16 @@ int bgp_rfapi_cfg_write(struct vty *vty, struct bgp *bgp)
|
||||
|
||||
if (rfg->routemap_export_bgp_name) {
|
||||
vty_out(vty, " export %sroute-map %s\n",
|
||||
(rfg->type == RFAPI_GROUP_CFG_VRF ? "" : "bgp "),
|
||||
(rfg->type == RFAPI_GROUP_CFG_VRF
|
||||
? ""
|
||||
: "bgp "),
|
||||
rfg->routemap_export_bgp_name);
|
||||
}
|
||||
if (rfg->routemap_export_zebra_name) {
|
||||
vty_out(vty, " export %sroute-map %s\n",
|
||||
(rfg->type == RFAPI_GROUP_CFG_VRF ? "" : "zebra "),
|
||||
(rfg->type == RFAPI_GROUP_CFG_VRF
|
||||
? ""
|
||||
: "zebra "),
|
||||
rfg->routemap_export_zebra_name);
|
||||
}
|
||||
if (rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT]) {
|
||||
@ -4098,7 +4106,8 @@ int bgp_rfapi_cfg_write(struct vty *vty, struct bgp *bgp)
|
||||
}
|
||||
|
||||
if (hc->default_rd.prefixlen
|
||||
|| hc->default_response_lifetime != BGP_VNC_DEFAULT_RESPONSE_LIFETIME_DEFAULT
|
||||
|| hc->default_response_lifetime
|
||||
!= BGP_VNC_DEFAULT_RESPONSE_LIFETIME_DEFAULT
|
||||
|| hc->default_rt_import_list || hc->default_rt_export_list
|
||||
|| hc->nve_groups_sequential->count) {
|
||||
|
||||
@ -4184,8 +4193,8 @@ int bgp_rfapi_cfg_write(struct vty *vty, struct bgp *bgp)
|
||||
|
||||
prefix2str(&rfg->vn_prefix, buf,
|
||||
sizeof(buf));
|
||||
vty_out(vty, " prefix %s %s\n",
|
||||
"vn", buf);
|
||||
vty_out(vty, " prefix %s %s\n", "vn",
|
||||
buf);
|
||||
}
|
||||
|
||||
if (rfg->un_prefix.family && rfg->un_node) {
|
||||
@ -4193,8 +4202,8 @@ int bgp_rfapi_cfg_write(struct vty *vty, struct bgp *bgp)
|
||||
|
||||
prefix2str(&rfg->un_prefix, buf,
|
||||
sizeof(buf));
|
||||
vty_out(vty, " prefix %s %s\n",
|
||||
"un", buf);
|
||||
vty_out(vty, " prefix %s %s\n", "un",
|
||||
buf);
|
||||
}
|
||||
|
||||
|
||||
@ -4215,10 +4224,9 @@ int bgp_rfapi_cfg_write(struct vty *vty, struct bgp *bgp)
|
||||
value);
|
||||
|
||||
} else
|
||||
vty_out(vty,
|
||||
" rd %s\n",
|
||||
prefix_rd2str(&rfg->rd,
|
||||
buf,
|
||||
vty_out(vty, " rd %s\n",
|
||||
prefix_rd2str(
|
||||
&rfg->rd, buf,
|
||||
sizeof(buf)));
|
||||
}
|
||||
if (rfg->flags & RFAPI_RFG_RESPONSE_LIFETIME) {
|
||||
|
Loading…
Reference in New Issue
Block a user