Merge branch 'master' into type5-with-asymm

This commit is contained in:
Mitesh Kanjariya 2018-02-12 02:05:00 -08:00 committed by GitHub
commit efc812a379
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 515 additions and 516 deletions

View File

@ -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),

View File

@ -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);

View File

@ -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,
@ -389,7 +389,7 @@ DEFUN (show_bgp_ip_vpn_all_rd,
if (argv_find_and_parse_afi(argv, argc, &idx, &afi)) {
if (argv_find(argv, argc, "rd", &idx)) {
ret = str2prefix_rd(argv[idx+1]->arg, &prd);
ret = str2prefix_rd(argv[idx + 1]->arg, &prd);
if (!ret) {
vty_out(vty,
"%% Malformed Route Distinguisher\n");

File diff suppressed because it is too large Load Diff

View File

@ -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);
}
@ -3599,9 +3598,9 @@ DEFUN (set_ip_nexthop_peer,
"Use peer address (for BGP only)\n")
{
int (*func)(struct vty *, struct route_map_index *, const char *,
const char *) = strmatch(argv[0]->text, "no")
? generic_set_delete
: generic_set_add;
const char *) = strmatch(argv[0]->text, "no")
? generic_set_delete
: generic_set_add;
return func(vty, VTY_GET_CONTEXT(route_map_index), "ip next-hop",
"peer-address");
@ -3617,9 +3616,9 @@ DEFUN (set_ip_nexthop_unchanged,
"Don't modify existing Next hop address\n")
{
int (*func)(struct vty *, struct route_map_index *, const char *,
const char *) = strmatch(argv[0]->text, "no")
? generic_set_delete
: generic_set_add;
const char *) = strmatch(argv[0]->text, "no")
? generic_set_delete
: generic_set_add;
return func(vty, VTY_GET_CONTEXT(route_map_index), "ip next-hop",
"unchanged");
@ -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;

View File

@ -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")
@ -1868,14 +1869,14 @@ static void bgp_redistribute_redo(struct bgp *bgp)
struct listnode *node;
struct bgp_redist *red;
for (afi = AFI_IP; afi < AFI_MAX; afi++) {
for (i = 0; i < ZEBRA_ROUTE_MAX; i++) {
for (afi = AFI_IP; afi < AFI_MAX; afi++) {
for (i = 0; i < ZEBRA_ROUTE_MAX; i++) {
red_list = bgp->redist[afi][i];
if (!red_list)
continue;
red_list = bgp->redist[afi][i];
if (!red_list)
continue;
for (ALL_LIST_ELEMENTS_RO(red_list, node, red)) {
for (ALL_LIST_ELEMENTS_RO(red_list, node, red)) {
bgp_redistribute_resend(bgp, afi, i,
red->instance);
}
@ -4363,23 +4364,23 @@ 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,
PEER_FLAG_AS_PATH_UNCHANGED)) {
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,
PEER_FLAG_NEXTHOP_UNCHANGED)) {
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,
PEER_FLAG_MED_UNCHANGED)) {
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");
@ -6511,8 +6512,8 @@ DEFUN (show_bgp_vrfs,
if (!uj && count == 1)
vty_out(vty,
"%4s %-5s %-16s %9s %10s %-37s %-10s %-15s\n",
"Type", "Id", "routerId", "#PeersVfg",
"#PeersEstb", "Name", "L3-VNI", "Rmac");
"Type", "Id", "routerId", "#PeersVfg",
"#PeersEstb", "Name", "L3-VNI", "Rmac");
peers_cfg = peers_estb = 0;
if (uj)
@ -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,8 +6571,9 @@ DEFUN (show_bgp_vrfs,
json_object_int_add(json, "totalVrfs", count);
vty_out(vty, "%s\n", json_object_to_json_string_ext(
json, JSON_C_TO_STRING_PRETTY));
vty_out(vty, "%s\n",
json_object_to_json_string_ext(
json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
} else {
if (count)
@ -6718,17 +6722,20 @@ 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 * sizeof(struct community)));
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 * sizeof(struct ecommunity)));
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 * sizeof(struct lcommunity)));
count,
mtype_memstr(memstrbuf, sizeof(memstrbuf),
count * sizeof(struct lcommunity)));
if ((count = mtype_stats_alloc(MTYPE_CLUSTER)))
vty_out(vty, "%ld Cluster lists, using %s of memory\n", count,
@ -6757,8 +6764,9 @@ 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 * sizeof(regex_t)));
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,8 +7018,9 @@ 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
peer_group));
ents
* sizeof(struct
peer_group));
}
if (CHECK_FLAG(bgp->af_flags[afi][safi],
@ -7039,10 +7043,11 @@ 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
bgp_node)));
mtype_memstr(
memstrbuf, sizeof(memstrbuf),
ents
* sizeof(struct
bgp_node)));
/* Peer related usage */
ents = listcount(bgp->peer);
@ -7059,8 +7064,9 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
mtype_memstr(
memstrbuf,
sizeof(memstrbuf),
ents * sizeof(struct
peer_group)));
ents
* sizeof(struct
peer_group)));
if (CHECK_FLAG(bgp->af_flags[afi][safi],
BGP_CONFIG_DAMPENING))
@ -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,8 +7199,9 @@ 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(
json, JSON_C_TO_STRING_PRETTY));
vty_out(vty, "%s\n",
json_object_to_json_string_ext(
json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
} else {
if (count)
@ -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,8 +9639,9 @@ 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->t_pmax_restart));
p->host,
thread_timer_remain_second(
p->t_pmax_restart));
} else {
if (use_json)
json_object_boolean_true_add(
@ -9874,8 +9885,9 @@ 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(
json, JSON_C_TO_STRING_PRETTY));
vty_out(vty, "%s\n",
json_object_to_json_string_ext(
json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
} else {
vty_out(vty, "\n");
@ -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);

View File

@ -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. */
@ -1771,7 +1768,7 @@ static int bgp_zebra_process_local_vni(int command, struct zclient *zclient,
struct stream *s;
vni_t vni;
struct bgp *bgp;
struct in_addr vtep_ip = { INADDR_ANY };
struct in_addr vtep_ip = {INADDR_ANY};
vrf_id_t tenant_vrf_id = VRF_DEFAULT;
s = zclient->ibuf;
@ -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);
}
}

View File

@ -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);
@ -2654,7 +2652,7 @@ int peer_group_bind(struct bgp *bgp, union sockunion *su, struct peer *peer,
}
} else if (peer->afc[afi][safi])
peer_deactivate(peer, afi, safi);
}
}
if (peer->group) {
assert(group && peer->group == group);
@ -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,8 +3985,9 @@ 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
| PEER_FLAG_ADDPATH_TX_BESTPATH_PER_AS)) {
if (flag
& (PEER_FLAG_ADDPATH_TX_ALL_PATHS
| PEER_FLAG_ADDPATH_TX_BESTPATH_PER_AS)) {
bgp = peer->bgp;
addpath_tx_used = 0;
@ -6802,8 +6800,9 @@ 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,
PEER_FLAG_SEND_COMMUNITY))
&& (!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)
&& (!g_peer
@ -6811,9 +6810,10 @@ 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, afi, safi,
PEER_FLAG_SEND_LARGE_COMMUNITY))) {
&& (!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",
addr);
} else {
@ -6841,9 +6841,10 @@ 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, afi, safi,
PEER_FLAG_SEND_COMMUNITY))) {
&& (!g_peer
|| peer_af_flag_check(
g_peer, afi, safi,
PEER_FLAG_SEND_COMMUNITY))) {
vty_out(vty,
" no neighbor %s send-community\n",
addr);
@ -6954,17 +6955,17 @@ 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,
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,
PEER_FLAG_MED_UNCHANGED)) {
vty_out(vty,
" neighbor %s attribute-unchanged%s%s%s\n",

View File

@ -262,13 +262,14 @@ 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 */
u_int32_t maxmed_value; /* Max-med value when its active */
u_char maxmed_active; /* 1/0 if max-med is active or not */
u_int32_t maxmed_value; /* Max-med value when its active */
/* BGP update delay on startup */
struct thread *t_update_delay;
@ -829,8 +830,8 @@ struct peer {
#define PEER_CONFIG_ROUTEADV (1 << 2) /* route advertise */
#define PEER_GROUP_CONFIG_TIMER (1 << 3) /* timers from peer-group */
#define PEER_OR_GROUP_TIMER_SET(peer) \
(CHECK_FLAG(peer->config, PEER_CONFIG_TIMER) \
#define PEER_OR_GROUP_TIMER_SET(peer) \
(CHECK_FLAG(peer->config, PEER_CONFIG_TIMER) \
|| CHECK_FLAG(peer->config, PEER_GROUP_CONFIG_TIMER))
_Atomic uint32_t holdtime;
@ -870,21 +871,29 @@ struct peer {
/* workqueues */
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)
#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)
#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)
#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)
/* Statistics field */
_Atomic uint32_t open_in; /* Open message input count */
@ -899,7 +908,7 @@ struct peer {
_Atomic uint32_t refresh_in; /* Route Refresh input count */
_Atomic uint32_t refresh_out; /* Route Refresh output count */
_Atomic uint32_t dynamic_cap_in; /* Dynamic Capability input count. */
_Atomic uint32_t dynamic_cap_out; /* Dynamic Capability output count. */
_Atomic uint32_t dynamic_cap_out; /* Dynamic Capability output count. */
/* BGP state count */
u_int32_t established; /* Established */
@ -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);

View File

@ -260,20 +260,21 @@ int bgp_rfapi_is_vnc_configured(struct bgp *bgp)
/***********************************************************************
* VNC Configuration/CLI
***********************************************************************/
#define VNC_VTY_CONFIG_CHECK(bgp) \
{ \
switch (bgp_rfapi_is_vnc_configured(bgp)) { \
case EPERM: \
vty_out(vty, "VNC operations only permitted on default BGP instance.\n"); \
return CMD_WARNING_CONFIG_FAILED; \
break; \
case ENXIO: \
vty_out(vty, "VNC not configured.\n"); \
return CMD_WARNING_CONFIG_FAILED; \
break; \
default: \
break; \
} \
#define VNC_VTY_CONFIG_CHECK(bgp) \
{ \
switch (bgp_rfapi_is_vnc_configured(bgp)) { \
case EPERM: \
vty_out(vty, \
"VNC operations only permitted on default BGP instance.\n"); \
return CMD_WARNING_CONFIG_FAILED; \
break; \
case ENXIO: \
vty_out(vty, "VNC not configured.\n"); \
return CMD_WARNING_CONFIG_FAILED; \
break; \
default: \
break; \
} \
}
DEFUN (vnc_advertise_un_method,
@ -509,9 +510,8 @@ 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
int */
rspint = INT32_MAX; /* is really an int, not an unsigned
int */
}
bgp->rfapi_cfg->default_response_lifetime = rspint;
@ -1631,14 +1631,14 @@ DEFUN (vnc_nve_group_export_no_prefixlist,
return CMD_WARNING_CONFIG_FAILED;
}
if (argv[idx-1]->text[0] == 'z')
if (argv[idx - 1]->text[0] == 'z')
is_bgp = 0;
idx += 2; /* skip afi and keyword */
idx += 2; /* skip afi and keyword */
if (is_bgp) {
if (idx == argc ||
strmatch(argv[idx]->arg,
rfg->plist_export_bgp_name[afi])) {
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]);
rfg->plist_export_bgp_name[afi] = NULL;
@ -1647,9 +1647,9 @@ DEFUN (vnc_nve_group_export_no_prefixlist,
vnc_direct_bgp_reexport_group_afi(bgp, rfg, afi);
}
} else {
if (idx == argc ||
strmatch(argv[idx]->arg,
rfg->plist_export_zebra_name[afi])) {
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]);
rfg->plist_export_zebra_name[afi] = NULL;
@ -1700,7 +1700,7 @@ DEFUN (vnc_nve_group_export_prefixlist,
return CMD_WARNING_CONFIG_FAILED;
}
if (argv[idx-1]->text[0] == 'z')
if (argv[idx - 1]->text[0] == 'z')
is_bgp = 0;
idx = argc - 1;
@ -1758,18 +1758,19 @@ DEFUN (vnc_nve_group_export_no_routemap,
switch (argv[idx]->text[0]) {
case 'z':
is_bgp = 0;
/* fall thru */
/* fall thru */
case 'b':
idx += 2;
break;
default: /* route-map */
default: /* route-map */
idx++;
break;
}
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,9 +1780,9 @@ 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,
rfg->routemap_export_zebra_name)) {
if (idx == argc
|| strmatch(argv[idx]->arg,
rfg->routemap_export_zebra_name)) {
if (rfg->routemap_export_zebra_name)
free(rfg->routemap_export_zebra_name);
rfg->routemap_export_zebra_name = NULL;
@ -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,11 +4224,10 @@ int bgp_rfapi_cfg_write(struct vty *vty, struct bgp *bgp)
value);
} else
vty_out(vty,
" rd %s\n",
prefix_rd2str(&rfg->rd,
buf,
sizeof(buf)));
vty_out(vty, " rd %s\n",
prefix_rd2str(
&rfg->rd, buf,
sizeof(buf)));
}
if (rfg->flags & RFAPI_RFG_RESPONSE_LIFETIME) {
vty_out(vty, " response-lifetime ");

View File

@ -6,7 +6,7 @@ import sys, re, subprocess, os
# find all DEFUNs
defun_re = re.compile(
r'^(DEF(UN(_NOSH|_HIDDEN)?|PY)\s*\(.*?)^(?=\s*\{)',
r'^((DEF(UN(_NOSH|_HIDDEN)?|PY)|ALIAS)\s*\(.*?)^(?=\s*\{)',
re.M | re.S)
define_re = re.compile(
r'((^#\s*define[^\n]+[^\\]\n)+)',