summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/ISSUE_TEMPLATE/bug_report.md4
-rw-r--r--bfdd/bfd.c2
-rw-r--r--bfdd/bfd.h2
-rw-r--r--bgpd/bgp_aspath.c18
-rw-r--r--bgpd/bgp_attr.c103
-rw-r--r--bgpd/bgp_attr.h41
-rw-r--r--bgpd/bgp_conditional_adv.c2
-rw-r--r--bgpd/bgp_ecommunity.c2
-rw-r--r--bgpd/bgp_evpn.c15
-rw-r--r--bgpd/bgp_evpn_mh.c32
-rw-r--r--bgpd/bgp_evpn_mh.h11
-rw-r--r--bgpd/bgp_evpn_vty.c40
-rw-r--r--bgpd/bgp_lcommunity.c2
-rw-r--r--bgpd/bgp_mpath.c12
-rw-r--r--bgpd/bgp_mplsvpn.c51
-rw-r--r--bgpd/bgp_mplsvpn.h4
-rw-r--r--bgpd/bgp_nht.c6
-rw-r--r--bgpd/bgp_packet.c2
-rw-r--r--bgpd/bgp_route.c31
-rw-r--r--bgpd/bgp_routemap.c25
-rw-r--r--bgpd/bgp_updgrp.c2
-rw-r--r--bgpd/bgp_updgrp.h9
-rw-r--r--bgpd/bgp_updgrp_adv.c2
-rw-r--r--bgpd/bgp_updgrp_packet.c6
-rw-r--r--bgpd/bgp_vty.c26
-rw-r--r--bgpd/bgpd.c36
-rw-r--r--bgpd/bgpd.h18
-rw-r--r--bgpd/rfapi/rfapi.c4
-rw-r--r--bgpd/rfapi/vnc_export_bgp.c3
-rw-r--r--configure.ac2
-rw-r--r--debian/changelog6
-rw-r--r--debian/frr.logrotate2
-rw-r--r--debian/frr.preinst1
-rw-r--r--doc/developer/building-frr-for-fedora.rst2
-rw-r--r--doc/developer/building-frr-for-opensuse.rst2
-rw-r--r--doc/developer/lists.rst6
-rw-r--r--doc/developer/static-linking.rst2
-rw-r--r--doc/user/basic.rst2
-rw-r--r--doc/user/bfd.rst2
-rw-r--r--doc/user/pimv6.rst8
-rw-r--r--doc/user/scripting.rst2
-rw-r--r--doc/user/zebra.rst19
-rw-r--r--isisd/isis_adjacency.c10
-rw-r--r--isisd/isis_circuit.c7
-rw-r--r--isisd/isis_ldp_sync.c6
-rw-r--r--isisd/isis_nb_config.c48
-rw-r--r--isisd/isis_pdu.c2
-rw-r--r--isisd/isis_pdu.h2
-rw-r--r--isisd/isis_route.c2
-rw-r--r--ldpd/ldpd.c2
-rw-r--r--lib/atomlist.c2
-rw-r--r--lib/privs.c2
-rw-r--r--lib/route_types.txt2
-rw-r--r--lib/subdir.am2
-rw-r--r--ospf6d/ospf6_flood.c43
-rw-r--r--ospf6d/ospf6_interface.c2
-rw-r--r--ospf6d/ospf6_lsdb.h2
-rw-r--r--ospfd/ospf_interface.c2
-rw-r--r--ospfd/ospf_ldp_sync.c6
-rw-r--r--ospfd/ospf_lsa.c4
-rw-r--r--ospfd/ospf_packet.c8
-rw-r--r--ospfd/ospf_spf.c2
-rw-r--r--pimd/pim6_cmd.c35
-rw-r--r--pimd/pim6_cmd.h1
-rw-r--r--pimd/pim_bsm.c6
-rw-r--r--pimd/pim_cmd.c46
-rw-r--r--pimd/pim_cmd_common.c22
-rw-r--r--pimd/pim_cmd_common.h2
-rw-r--r--pimd/pim_iface.c2
-rw-r--r--pimd/pim_igmp.c2
-rw-r--r--pimd/pim_igmpv3.c10
-rw-r--r--pimd/pim_mlag.c2
-rw-r--r--pimd/pim_ssmpingd.c6
-rw-r--r--pimd/pim_vty.c4
-rw-r--r--redhat/frr.logrotate8
-rw-r--r--redhat/frr.spec.in2
-rw-r--r--ripd/rip_offset.c4
-rw-r--r--ripd/ripd.h2
-rw-r--r--ripngd/ripng_offset.c4
-rw-r--r--tests/isisd/test_topologies.c2
-rw-r--r--tests/lib/test_table.c4
-rw-r--r--tests/topotests/bgp_auth/test_bgp_auth.py2
-rw-r--r--tests/topotests/bgp_basic_functionality_topo1/test_bgp_basic_functionality.py2
-rwxr-xr-xtests/topotests/bgp_evpn_overlay_index_gateway/test_bgp_evpn_overlay_index_gateway.py2
-rwxr-xr-xtests/topotests/bgp_evpn_vxlan_topo1/test_bgp_evpn_vxlan.py2
-rw-r--r--tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-3.py2
-rw-r--r--tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-4.py10
-rw-r--r--tests/topotests/bgp_lu_topo1/test_bgp_lu.py2
-rw-r--r--tests/topotests/bgp_multi_vrf_topo2/test_bgp_multi_vrf_topo2.py10
-rwxr-xr-xtests/topotests/bgp_snmp_mplsl3vpn/test_bgp_snmp_mplsvpn.py2
-rw-r--r--tests/topotests/grpc_basic/test_basic_grpc.py2
-rw-r--r--tests/topotests/lib/ltemplate.py2
-rw-r--r--tests/topotests/lib/topogen.py2
-rw-r--r--tests/topotests/lib/topotest.py10
-rw-r--r--tests/topotests/multicast_pim_bsm_topo1/test_mcast_pim_bsmp_01.py4
-rwxr-xr-xtests/topotests/multicast_pim_static_rp_topo1/test_multicast_pim_static_rp.py10
-rw-r--r--tests/topotests/ospf_suppress_fa/test_ospf_suppress_fa.py2
-rwxr-xr-xtests/topotests/simple_snmp_test/test_simple_snmp.py2
-rw-r--r--tests/topotests/static_routing_with_ibgp/test_static_routes_topo4_ibgp.py2
-rw-r--r--tests/topotests/zebra_multiple_connected/r1/ip_route2.json102
-rw-r--r--tests/topotests/zebra_multiple_connected/test_zebra_multiple_connected.py24
-rw-r--r--tools/etc/rsyslog.d/45-frr.conf2
-rw-r--r--tools/frrinit.sh.in4
-rw-r--r--vtysh/vtysh.c12
-rw-r--r--watchfrr/watchfrr.c55
-rw-r--r--zebra/connected.c4
-rw-r--r--zebra/interface.c2
-rw-r--r--zebra/rt_netlink.c2
-rw-r--r--zebra/zebra_dplane.c2
-rw-r--r--zebra/zebra_evpn_mh.c41
-rw-r--r--zebra/zebra_evpn_mh.h11
-rw-r--r--zebra/zebra_fpm_netlink.c2
-rw-r--r--zebra/zebra_nhg.c13
113 files changed, 726 insertions, 507 deletions
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 8983b39eb3..895e8ad0dc 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -50,8 +50,8 @@ A clear and concise description of what the bug is.
Put "x" in "[ ]" if you already tried following:
-->
-[ ] Did you check if this is a duplicate issue?
-[ ] Did you test it on the latest FRRouting/frr master branch?
+- [ ] Did you check if this is a duplicate issue?
+- [ ] Did you test it on the latest FRRouting/frr master branch?
**To Reproduce**
diff --git a/bfdd/bfd.c b/bfdd/bfd.c
index 455dd9fe85..d52eeeddba 100644
--- a/bfdd/bfd.c
+++ b/bfdd/bfd.c
@@ -769,7 +769,7 @@ static void _bfd_session_update(struct bfd_session *bs,
* Apply profile last: it also calls `bfd_set_shutdown`.
*
* There is no problem calling `shutdown` twice if the value doesn't
- * change or if it is overriden by peer specific configuration.
+ * change or if it is overridden by peer specific configuration.
*/
if (bpc->bpc_has_profile)
bfd_profile_apply(bpc->bpc_profile, bs);
diff --git a/bfdd/bfd.h b/bfdd/bfd.h
index 7ab5ef13b4..00cc431e10 100644
--- a/bfdd/bfd.h
+++ b/bfdd/bfd.h
@@ -724,7 +724,7 @@ void bfd_profile_free(struct bfd_profile *bp);
/**
* Apply a profile configuration to an existing BFD session. The non default
- * values will not be overriden.
+ * values will not be overridden.
*
* NOTE: if the profile doesn't exist yet, then the profile will be applied
* once it begins to exist.
diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c
index dd27c9f6a1..fd644ebf0a 100644
--- a/bgpd/bgp_aspath.c
+++ b/bgpd/bgp_aspath.c
@@ -544,7 +544,7 @@ static void aspath_make_str_count(struct aspath *as, bool make_json)
seg = as->segments;
-/* ASN takes 5 to 10 chars plus seperator, see below.
+/* ASN takes 5 to 10 chars plus separator, see below.
* If there is one differing segment type, we need an additional
* 2 chars for segment delimiters, and the final '\0'.
* Hopefully this is large enough to avoid hitting the realloc
@@ -560,17 +560,17 @@ static void aspath_make_str_count(struct aspath *as, bool make_json)
while (seg) {
int i;
- char seperator;
+ char separator;
- /* Check AS type validity. Set seperator for segment */
+ /* Check AS type validity. Set separator for segment */
switch (seg->type) {
case AS_SET:
case AS_CONFED_SET:
- seperator = ',';
+ separator = ',';
break;
case AS_SEQUENCE:
case AS_CONFED_SEQUENCE:
- seperator = ' ';
+ separator = ' ';
break;
default:
XFREE(MTYPE_AS_STR, str_buf);
@@ -584,7 +584,7 @@ static void aspath_make_str_count(struct aspath *as, bool make_json)
/* We might need to increase str_buf, particularly if path has
* differing segments types, our initial guesstimate above will
- * have been wrong. Need 10 chars for ASN, a seperator each and
+ * have been wrong. Need 10 chars for ASN, a separator each and
* potentially two segment delimiters, plus a space between each
* segment and trailing zero.
*
@@ -607,7 +607,7 @@ static void aspath_make_str_count(struct aspath *as, bool make_json)
if (make_json)
jseg_list = json_object_new_array();
- /* write out the ASNs, with their seperators, bar the last one*/
+ /* write out the ASNs, with their separators, bar the last one*/
for (i = 0; i < seg->length; i++) {
if (make_json)
json_object_array_add(
@@ -619,7 +619,7 @@ static void aspath_make_str_count(struct aspath *as, bool make_json)
if (i < (seg->length - 1))
len += snprintf(str_buf + len, str_size - len,
- "%c", seperator);
+ "%c", separator);
}
if (make_json) {
@@ -1917,7 +1917,7 @@ static const char *aspath_gettoken(const char *buf, enum as_token *token,
{
const char *p = buf;
- /* Skip seperators (space for sequences, ',' for sets). */
+ /* Skip separators (space for sequences, ',' for sets). */
while (isspace((unsigned char)*p) || *p == ',')
p++;
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index 2f246e61d8..118931a4df 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -847,7 +847,7 @@ struct attr *bgp_attr_intern(struct attr *attr)
struct lcommunity *lcomm = NULL;
struct community *comm = NULL;
- /* Intern referenced strucutre. */
+ /* Intern referenced structure. */
if (attr->aspath) {
if (!attr->aspath->refcnt)
attr->aspath = aspath_intern(attr->aspath);
@@ -986,6 +986,10 @@ struct attr *bgp_attr_aggregate_intern(
attr.origin = origin;
attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_ORIGIN);
+ /* MED */
+ attr.med = 0;
+ attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC);
+
/* AS path attribute. */
if (aspath)
attr.aspath = aspath_intern(aspath);
@@ -1008,18 +1012,13 @@ struct attr *bgp_attr_aggregate_intern(
}
bgp_attr_set_community(&attr, community);
- attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES);
}
- if (ecommunity) {
+ if (ecommunity)
bgp_attr_set_ecommunity(&attr, ecommunity);
- attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
- }
- if (lcommunity) {
+ if (lcommunity)
bgp_attr_set_lcommunity(&attr, lcommunity);
- attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES);
- }
if (bgp_in_graceful_shutdown(bgp))
bgp_attr_add_gshut_community(&attr);
@@ -1096,22 +1095,18 @@ void bgp_attr_unintern_sub(struct attr *attr)
comm = bgp_attr_get_community(attr);
community_unintern(&comm);
- UNSET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES));
bgp_attr_set_community(attr, NULL);
ecomm = bgp_attr_get_ecommunity(attr);
ecommunity_unintern(&ecomm);
- UNSET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES));
bgp_attr_set_ecommunity(attr, NULL);
ipv6_ecomm = bgp_attr_get_ipv6_ecommunity(attr);
ecommunity_unintern(&ipv6_ecomm);
- UNSET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_IPV6_EXT_COMMUNITIES));
bgp_attr_set_ipv6_ecommunity(attr, NULL);
lcomm = bgp_attr_get_lcommunity(attr);
lcommunity_unintern(&lcomm);
- UNSET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES));
bgp_attr_set_lcommunity(attr, NULL);
cluster = bgp_attr_get_cluster(attr);
@@ -1243,7 +1238,7 @@ void bgp_attr_flush(struct attr *attr)
* are partial/optional and hence where the error likely was not
* introduced by the sending neighbour.
*/
-static bgp_attr_parse_ret_t
+static enum bgp_attr_parse_ret
bgp_attr_malformed(struct bgp_attr_parser_args *args, uint8_t subcode,
bgp_size_t length)
{
@@ -1450,7 +1445,8 @@ static bool bgp_attr_flag_invalid(struct bgp_attr_parser_args *args)
}
/* Get origin attribute of the update message. */
-static bgp_attr_parse_ret_t bgp_attr_origin(struct bgp_attr_parser_args *args)
+static enum bgp_attr_parse_ret
+bgp_attr_origin(struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
@@ -1520,8 +1516,8 @@ static int bgp_attr_aspath(struct bgp_attr_parser_args *args)
return BGP_ATTR_PARSE_PROCEED;
}
-static bgp_attr_parse_ret_t bgp_attr_aspath_check(struct peer *const peer,
- struct attr *const attr)
+static enum bgp_attr_parse_ret bgp_attr_aspath_check(struct peer *const peer,
+ struct attr *const attr)
{
/* These checks were part of bgp_attr_aspath, but with
* as4 we should to check aspath things when
@@ -1603,8 +1599,8 @@ static int bgp_attr_as4_path(struct bgp_attr_parser_args *args,
/*
* Check that the nexthop attribute is valid.
*/
-bgp_attr_parse_ret_t
-bgp_attr_nexthop_valid(struct peer *peer, struct attr *attr)
+enum bgp_attr_parse_ret bgp_attr_nexthop_valid(struct peer *peer,
+ struct attr *attr)
{
in_addr_t nexthop_h;
@@ -1633,7 +1629,8 @@ bgp_attr_nexthop_valid(struct peer *peer, struct attr *attr)
}
/* Nexthop attribute. */
-static bgp_attr_parse_ret_t bgp_attr_nexthop(struct bgp_attr_parser_args *args)
+static enum bgp_attr_parse_ret
+bgp_attr_nexthop(struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
@@ -1655,7 +1652,7 @@ static bgp_attr_parse_ret_t bgp_attr_nexthop(struct bgp_attr_parser_args *args)
}
/* MED atrribute. */
-static bgp_attr_parse_ret_t bgp_attr_med(struct bgp_attr_parser_args *args)
+static enum bgp_attr_parse_ret bgp_attr_med(struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
@@ -1678,7 +1675,7 @@ static bgp_attr_parse_ret_t bgp_attr_med(struct bgp_attr_parser_args *args)
}
/* Local preference attribute. */
-static bgp_attr_parse_ret_t
+static enum bgp_attr_parse_ret
bgp_attr_local_pref(struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
@@ -1790,7 +1787,7 @@ static int bgp_attr_aggregator(struct bgp_attr_parser_args *args)
}
/* New Aggregator attribute */
-static bgp_attr_parse_ret_t
+static enum bgp_attr_parse_ret
bgp_attr_as4_aggregator(struct bgp_attr_parser_args *args,
as_t *as4_aggregator_as,
struct in_addr *as4_aggregator_addr)
@@ -1834,7 +1831,7 @@ bgp_attr_as4_aggregator(struct bgp_attr_parser_args *args,
/* Munge Aggregator and New-Aggregator, AS_PATH and NEW_AS_PATH.
*/
-static bgp_attr_parse_ret_t
+static enum bgp_attr_parse_ret
bgp_attr_munge_as4_attrs(struct peer *const peer, struct attr *const attr,
struct aspath *as4_path, as_t as4_aggregator,
struct in_addr *as4_aggregator_addr)
@@ -1936,7 +1933,7 @@ bgp_attr_munge_as4_attrs(struct peer *const peer, struct attr *const attr,
}
/* Community attribute. */
-static bgp_attr_parse_ret_t
+static enum bgp_attr_parse_ret
bgp_attr_community(struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
@@ -1963,13 +1960,11 @@ bgp_attr_community(struct bgp_attr_parser_args *args)
return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_OPT_ATTR_ERR,
args->total);
- attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES);
-
return BGP_ATTR_PARSE_PROCEED;
}
/* Originator ID attribute. */
-static bgp_attr_parse_ret_t
+static enum bgp_attr_parse_ret
bgp_attr_originator_id(struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
@@ -1997,7 +1992,7 @@ bgp_attr_originator_id(struct bgp_attr_parser_args *args)
}
/* Cluster list attribute. */
-static bgp_attr_parse_ret_t
+static enum bgp_attr_parse_ret
bgp_attr_cluster_list(struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
@@ -2268,7 +2263,7 @@ int bgp_mp_unreach_parse(struct bgp_attr_parser_args *args,
}
/* Large Community attribute. */
-static bgp_attr_parse_ret_t
+static enum bgp_attr_parse_ret
bgp_attr_large_community(struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
@@ -2294,13 +2289,11 @@ bgp_attr_large_community(struct bgp_attr_parser_args *args)
return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_OPT_ATTR_ERR,
args->total);
- attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES);
-
return BGP_ATTR_PARSE_PROCEED;
}
/* Extended Community attribute. */
-static bgp_attr_parse_ret_t
+static enum bgp_attr_parse_ret
bgp_attr_ext_communities(struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
@@ -2332,8 +2325,6 @@ bgp_attr_ext_communities(struct bgp_attr_parser_args *args)
return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_OPT_ATTR_ERR,
args->total);
- attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
-
/* Extract DF election preference and mobility sequence number */
attr->df_pref = bgp_attr_df_pref_from_ec(attr, &attr->df_alg);
@@ -2376,7 +2367,7 @@ bgp_attr_ext_communities(struct bgp_attr_parser_args *args)
}
/* IPv6 Extended Community attribute. */
-static bgp_attr_parse_ret_t
+static enum bgp_attr_parse_ret
bgp_attr_ipv6_ext_communities(struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
@@ -2403,8 +2394,6 @@ bgp_attr_ipv6_ext_communities(struct bgp_attr_parser_args *args)
return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_OPT_ATTR_ERR,
args->total);
- attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_IPV6_EXT_COMMUNITIES);
-
return BGP_ATTR_PARSE_PROCEED;
}
@@ -2541,7 +2530,7 @@ static int bgp_attr_encap(uint8_t type, struct peer *peer, /* IN */
/* SRv6 Service Data Sub-Sub-TLV attribute
* draft-ietf-bess-srv6-services-07
*/
-static bgp_attr_parse_ret_t
+static enum bgp_attr_parse_ret
bgp_attr_srv6_service_data(struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
@@ -2622,7 +2611,7 @@ bgp_attr_srv6_service_data(struct bgp_attr_parser_args *args)
/* SRv6 Service Sub-TLV attribute
* draft-ietf-bess-srv6-services-07
*/
-static bgp_attr_parse_ret_t
+static enum bgp_attr_parse_ret
bgp_attr_srv6_service(struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
@@ -2631,7 +2620,7 @@ bgp_attr_srv6_service(struct bgp_attr_parser_args *args)
uint8_t type, sid_flags;
uint16_t length, endpoint_behavior;
size_t headersz = sizeof(type) + sizeof(length);
- bgp_attr_parse_ret_t err;
+ enum bgp_attr_parse_ret err;
char buf[BUFSIZ];
if (STREAM_READABLE(peer->curr) < headersz) {
@@ -2717,8 +2706,9 @@ bgp_attr_srv6_service(struct bgp_attr_parser_args *args)
* Read an individual SID value returning how much data we have read
* Returns 0 if there was an error that needs to be passed up the stack
*/
-static bgp_attr_parse_ret_t bgp_attr_psid_sub(uint8_t type, uint16_t length,
- struct bgp_attr_parser_args *args)
+static enum bgp_attr_parse_ret
+bgp_attr_psid_sub(uint8_t type, uint16_t length,
+ struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
@@ -2925,11 +2915,11 @@ static bgp_attr_parse_ret_t bgp_attr_psid_sub(uint8_t type, uint16_t length,
/* Prefix SID attribute
* draft-ietf-idr-bgp-prefix-sid-05
*/
-bgp_attr_parse_ret_t bgp_attr_prefix_sid(struct bgp_attr_parser_args *args)
+enum bgp_attr_parse_ret bgp_attr_prefix_sid(struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
- bgp_attr_parse_ret_t ret;
+ enum bgp_attr_parse_ret ret;
attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_PREFIX_SID);
@@ -2988,7 +2978,7 @@ bgp_attr_parse_ret_t bgp_attr_prefix_sid(struct bgp_attr_parser_args *args)
/* PMSI tunnel attribute (RFC 6514)
* Basic validation checks done here.
*/
-static bgp_attr_parse_ret_t
+static enum bgp_attr_parse_ret
bgp_attr_pmsi_tunnel(struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
@@ -3036,7 +3026,8 @@ bgp_attr_pmsi_tunnel(struct bgp_attr_parser_args *args)
}
/* BGP unknown attribute treatment. */
-static bgp_attr_parse_ret_t bgp_attr_unknown(struct bgp_attr_parser_args *args)
+static enum bgp_attr_parse_ret
+bgp_attr_unknown(struct bgp_attr_parser_args *args)
{
bgp_size_t total = args->total;
struct transit *transit;
@@ -3141,11 +3132,12 @@ static int bgp_attr_check(struct peer *peer, struct attr *attr)
/* Read attribute of update packet. This function is called from
bgp_update_receive() in bgp_packet.c. */
-bgp_attr_parse_ret_t bgp_attr_parse(struct peer *peer, struct attr *attr,
- bgp_size_t size, struct bgp_nlri *mp_update,
- struct bgp_nlri *mp_withdraw)
+enum bgp_attr_parse_ret bgp_attr_parse(struct peer *peer, struct attr *attr,
+ bgp_size_t size,
+ struct bgp_nlri *mp_update,
+ struct bgp_nlri *mp_withdraw)
{
- bgp_attr_parse_ret_t ret;
+ enum bgp_attr_parse_ret ret;
uint8_t flag = 0;
uint8_t type = 0;
bgp_size_t length;
@@ -4185,9 +4177,14 @@ bgp_size_t bgp_packet_attribute(struct bgp *bgp, struct peer *peer,
if (CHECK_FLAG(peer->af_flags[afi][safi], PEER_FLAG_SEND_EXT_COMMUNITY)
&& (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES))) {
struct ecommunity *ecomm = bgp_attr_get_ecommunity(attr);
-
- if (peer->sort == BGP_PEER_IBGP
- || peer->sort == BGP_PEER_CONFED) {
+ bool transparent = CHECK_FLAG(peer->af_flags[afi][safi],
+ PEER_FLAG_RSERVER_CLIENT) &&
+ from &&
+ CHECK_FLAG(from->af_flags[afi][safi],
+ PEER_FLAG_RSERVER_CLIENT);
+
+ if (peer->sort == BGP_PEER_IBGP ||
+ peer->sort == BGP_PEER_CONFED || transparent) {
if (ecomm->size * 8 > 255) {
stream_putc(s,
BGP_ATTR_FLAG_OPTIONAL
diff --git a/bgpd/bgp_attr.h b/bgpd/bgp_attr.h
index 1f199da161..ac5734ede6 100644
--- a/bgpd/bgp_attr.h
+++ b/bgpd/bgp_attr.h
@@ -370,25 +370,25 @@ struct transit {
? bgp_attr_get_cluster((attr))->length \
: 0)
-typedef enum {
+enum bgp_attr_parse_ret {
BGP_ATTR_PARSE_PROCEED = 0,
BGP_ATTR_PARSE_ERROR = -1,
BGP_ATTR_PARSE_WITHDRAW = -2,
/* only used internally, send notify + convert to BGP_ATTR_PARSE_ERROR
- */
+ */
BGP_ATTR_PARSE_ERROR_NOTIFYPLS = -3,
BGP_ATTR_PARSE_EOR = -4,
-} bgp_attr_parse_ret_t;
+};
struct bpacket_attr_vec_arr;
/* Prototypes. */
extern void bgp_attr_init(void);
extern void bgp_attr_finish(void);
-extern bgp_attr_parse_ret_t bgp_attr_parse(struct peer *, struct attr *,
- bgp_size_t, struct bgp_nlri *,
- struct bgp_nlri *);
+extern enum bgp_attr_parse_ret bgp_attr_parse(struct peer *, struct attr *,
+ bgp_size_t, struct bgp_nlri *,
+ struct bgp_nlri *);
extern struct attr *bgp_attr_intern(struct attr *attr);
extern void bgp_attr_unintern_sub(struct attr *);
extern void bgp_attr_unintern(struct attr **);
@@ -432,7 +432,7 @@ extern int bgp_mp_reach_parse(struct bgp_attr_parser_args *args,
struct bgp_nlri *);
extern int bgp_mp_unreach_parse(struct bgp_attr_parser_args *args,
struct bgp_nlri *);
-extern bgp_attr_parse_ret_t
+extern enum bgp_attr_parse_ret
bgp_attr_prefix_sid(struct bgp_attr_parser_args *args);
extern struct bgp_attr_encap_subtlv *
@@ -471,8 +471,8 @@ extern void bgp_packet_mpunreach_prefix(
bool addpath_capable, uint32_t addpath_tx_id, struct attr *attr);
extern void bgp_packet_mpunreach_end(struct stream *s, size_t attrlen_pnt);
-extern bgp_attr_parse_ret_t bgp_attr_nexthop_valid(struct peer *peer,
- struct attr *attr);
+extern enum bgp_attr_parse_ret bgp_attr_nexthop_valid(struct peer *peer,
+ struct attr *attr);
static inline int bgp_rmap_nhop_changed(uint32_t out_rmap_flags,
uint32_t in_rmap_flags)
@@ -516,6 +516,11 @@ static inline void bgp_attr_set_ecommunity(struct attr *attr,
struct ecommunity *ecomm)
{
attr->ecommunity = ecomm;
+
+ if (ecomm)
+ SET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES));
+ else
+ UNSET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES));
}
static inline struct lcommunity *
@@ -528,6 +533,12 @@ static inline void bgp_attr_set_lcommunity(struct attr *attr,
struct lcommunity *lcomm)
{
attr->lcommunity = lcomm;
+
+ if (lcomm)
+ SET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES));
+ else
+ UNSET_FLAG(attr->flag,
+ ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES));
}
static inline struct community *bgp_attr_get_community(const struct attr *attr)
@@ -539,6 +550,11 @@ static inline void bgp_attr_set_community(struct attr *attr,
struct community *comm)
{
attr->community = comm;
+
+ if (comm)
+ SET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES));
+ else
+ UNSET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES));
}
static inline struct ecommunity *
@@ -551,6 +567,13 @@ static inline void bgp_attr_set_ipv6_ecommunity(struct attr *attr,
struct ecommunity *ipv6_ecomm)
{
attr->ipv6_ecommunity = ipv6_ecomm;
+
+ if (ipv6_ecomm)
+ SET_FLAG(attr->flag,
+ ATTR_FLAG_BIT(BGP_ATTR_IPV6_EXT_COMMUNITIES));
+ else
+ UNSET_FLAG(attr->flag,
+ ATTR_FLAG_BIT(BGP_ATTR_IPV6_EXT_COMMUNITIES));
}
static inline struct transit *bgp_attr_get_transit(const struct attr *attr)
diff --git a/bgpd/bgp_conditional_adv.c b/bgpd/bgp_conditional_adv.c
index f72a373a1c..dd1510a678 100644
--- a/bgpd/bgp_conditional_adv.c
+++ b/bgpd/bgp_conditional_adv.c
@@ -300,7 +300,7 @@ void bgp_conditional_adv_enable(struct peer *peer, afi_t afi, safi_t safi)
*/
peer->advmap_config_change[afi][safi] = true;
- /* advertise-map is already configured on atleast one of its
+ /* advertise-map is already configured on at least one of its
* neighbors (AFI/SAFI). So just increment the counter.
*/
if (++bgp->condition_filter_count > 1) {
diff --git a/bgpd/bgp_ecommunity.c b/bgpd/bgp_ecommunity.c
index 08caa24a1b..4120524e63 100644
--- a/bgpd/bgp_ecommunity.c
+++ b/bgpd/bgp_ecommunity.c
@@ -210,7 +210,7 @@ ecommunity_uniq_sort_internal(struct ecommunity *ecom,
return new;
}
-/* This function takes pointer to Extended Communites strucutre then
+/* This function takes pointer to Extended Communites structure then
* create a new Extended Communities structure by uniq and sort each
* Extended Communities value.
*/
diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c
index 9f3f8389ad..fbb0d2272a 100644
--- a/bgpd/bgp_evpn.c
+++ b/bgpd/bgp_evpn.c
@@ -759,8 +759,6 @@ static void build_evpn_type5_route_extcomm(struct bgp *bgp_vrf,
ecommunity_add_val(bgp_attr_get_ecommunity(attr), &eval_rmac,
true, true);
}
-
- attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
}
/*
@@ -870,8 +868,6 @@ static void build_evpn_route_extcomm(struct bgpevpn *vpn, struct attr *attr,
attr, ecommunity_merge(bgp_attr_get_ecommunity(attr),
&ecom_na));
}
-
- attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
}
/*
@@ -3370,7 +3366,9 @@ static int bgp_evpn_install_uninstall_table(struct bgp *bgp, afi_t afi,
assert(attr);
- /* Only type-2, type-3, type-4 and type-5 are supported currently */
+ /* Only type-1, type-2, type-3, type-4 and type-5
+ * are supported currently
+ */
if (!(evp->prefix.route_type == BGP_EVPN_MAC_IP_ROUTE
|| evp->prefix.route_type == BGP_EVPN_IMET_ROUTE
|| evp->prefix.route_type == BGP_EVPN_ES_ROUTE
@@ -3475,7 +3473,7 @@ static int bgp_evpn_install_uninstall_table(struct bgp *bgp, afi_t afi,
if (evp->prefix.route_type == BGP_EVPN_ES_ROUTE) {
/* we will match based on the entire esi to avoid
- * imoort of an es route for esi2 into esi1
+ * import of an es route for esi2 into esi1
*/
es = bgp_evpn_es_find(&evp->prefix.es_addr.esi);
if (es && bgp_evpn_is_es_local(es))
@@ -6101,8 +6099,9 @@ bool bgp_evpn_is_prefix_nht_supported(const struct prefix *pfx)
* EVPN routes should be marked as valid only if the nexthop is
* reachable. Only if this happens, the route should be imported
* (into VNI or VRF routing tables) and/or advertised.
- * Note: This is currently applied for EVPN type-2, type-3 and
- * type-5 routes. It may be tweaked later on for other routes, or
+ * Note: This is currently applied for EVPN type-1, type-2,
+ * type-3, type-4 and type-5 routes.
+ * It may be tweaked later on for other routes, or
* even removed completely when all routes are handled.
*/
if (pfx && pfx->family == AF_EVPN
diff --git a/bgpd/bgp_evpn_mh.c b/bgpd/bgp_evpn_mh.c
index f6516d220c..6db4cba44d 100644
--- a/bgpd/bgp_evpn_mh.c
+++ b/bgpd/bgp_evpn_mh.c
@@ -287,7 +287,7 @@ static int bgp_evpn_es_route_uninstall(struct bgp *bgp, struct bgp_evpn_es *es,
return ret;
}
-/* Install or unistall a Tyoe-4 route in the per-ES routing table */
+/* Install or unistall a Type-4 route in the per-ES routing table */
int bgp_evpn_es_route_install_uninstall(struct bgp *bgp, struct bgp_evpn_es *es,
afi_t afi, safi_t safi, struct prefix_evpn *evp,
struct bgp_path_info *pi, int install)
@@ -378,16 +378,16 @@ int bgp_evpn_mh_route_update(struct bgp *bgp, struct bgp_evpn_es *es,
remote_pi = tmp_pi;
}
- /* we don't expect to see a remote_ri at this point as
+ /* we don't expect to see a remote_pi at this point as
* an ES route has {esi, vtep_ip} as the key in the ES-rt-table
* in the VNI-rt-table.
*/
if (remote_pi) {
flog_err(
EC_BGP_ES_INVALID,
- "%u ERROR: local es route for ESI: %s Vtep %pI4 also learnt from remote",
+ "%u ERROR: local es route for ESI: %s vtep %pI4 also learnt from remote",
bgp->vrf_id, es ? es->esi_str : "Null",
- &es->originator_ip);
+ es ? &es->originator_ip : NULL);
return -1;
}
@@ -622,8 +622,6 @@ static void bgp_evpn_type4_route_extcomm_build(struct bgp_evpn_es *es,
bgp_attr_set_ecommunity(
attr,
ecommunity_merge(bgp_attr_get_ecommunity(attr), &ecom_df));
-
- attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
}
/* Create or update local type-4 route */
@@ -904,8 +902,6 @@ bgp_evpn_type1_es_route_extcomm_build(struct bgp_evpn_es_frag *es_frag,
ecom));
}
}
-
- attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
}
/* Extended communities associated with EAD-per-EVI */
@@ -932,8 +928,6 @@ static void bgp_evpn_type1_evi_route_extcomm_build(struct bgp_evpn_es *es,
bgp_attr_set_ecommunity(
attr,
ecommunity_merge(bgp_attr_get_ecommunity(attr), ecom));
-
- attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
}
/* Update EVPN EAD (type-1) route -
@@ -2875,7 +2869,7 @@ static void bgp_evpn_l3nhg_zebra_add_v4_or_v6(struct bgp_evpn_es_vrf *es_vrf,
static bool bgp_evpn_l3nhg_zebra_ok(struct bgp_evpn_es_vrf *es_vrf)
{
- if (!bgp_mh_info->host_routes_use_l3nhg && !bgp_mh_info->install_l3nhg)
+ if (!bgp_mh_info->host_routes_use_l3nhg)
return false;
/* Check socket. */
@@ -3449,14 +3443,11 @@ static void bgp_evpn_es_evi_vtep_re_eval_active(struct bgp *bgp,
new_active ? "active" : "inactive");
/* add VTEP to parent es */
- if (new_active) {
- struct bgp_evpn_es_vtep *es_vtep;
-
- es_vtep = bgp_evpn_es_vtep_add(bgp, evi_vtep->es_evi->es,
- evi_vtep->vtep_ip, false /*esr*/,
- 0, 0);
- evi_vtep->es_vtep = es_vtep;
- } else {
+ if (new_active)
+ evi_vtep->es_vtep = bgp_evpn_es_vtep_add(
+ bgp, evi_vtep->es_evi->es, evi_vtep->vtep_ip,
+ false /*esr*/, 0, 0);
+ else {
if (evi_vtep->es_vtep) {
bgp_evpn_es_vtep_do_del(bgp, evi_vtep->es_vtep,
false /*esr*/);
@@ -4401,14 +4392,12 @@ static uint32_t bgp_evpn_es_run_consistency_checks(struct bgp_evpn_es *es)
static void bgp_evpn_run_consistency_checks(struct thread *t)
{
int proc_cnt = 0;
- int es_cnt = 0;
struct listnode *node;
struct listnode *nextnode;
struct bgp_evpn_es *es;
for (ALL_LIST_ELEMENTS(bgp_mh_info->pend_es_list,
node, nextnode, es)) {
- ++es_cnt;
++proc_cnt;
/* run consistency checks on the ES and remove it from the
* pending list
@@ -4948,7 +4937,6 @@ void bgp_evpn_mh_init(void)
/* config knobs - XXX add cli to control it */
bgp_mh_info->ead_evi_adv_for_down_links = true;
bgp_mh_info->consistency_checking = true;
- bgp_mh_info->install_l3nhg = false;
bgp_mh_info->host_routes_use_l3nhg = BGP_EVPN_MH_USE_ES_L3NHG_DEF;
bgp_mh_info->suppress_l3_ecomm_on_inactive_es = true;
bgp_mh_info->bgp_evpn_nh_setup = true;
diff --git a/bgpd/bgp_evpn_mh.h b/bgpd/bgp_evpn_mh.h
index d9e2e72e4f..dc3fe44776 100644
--- a/bgpd/bgp_evpn_mh.h
+++ b/bgpd/bgp_evpn_mh.h
@@ -50,7 +50,9 @@ struct bgp_evpn_es_frag {
/* RD for this ES fragment */
struct prefix_rd prd;
- /* Memory used for linking bgp_evpn_es_rd to bgp_evpn_es->rd_list */
+ /* Memory used for linking bgp_evpn_es_frag to
+ * bgp_evpn_es->es_frag_list
+ */
struct listnode es_listnode;
/* List of ES-EVIs associated with this fragment */
@@ -59,11 +61,11 @@ struct bgp_evpn_es_frag {
/* Ethernet Segment entry -
* - Local and remote ESs are maintained in a global RB tree,
- * bgp_mh_info->es_rb_tree using ESI as key
+ * bgp_mh_info->es_rb_tree using ESI as key
* - Local ESs are received from zebra (BGP_EVPNES_LOCAL)
* - Remotes ESs are implicitly created (by reference) by a remote ES-EVI
* (BGP_EVPNES_REMOTE)
- * - An ES can be simulatenously LOCAL and REMOTE; infact all LOCAL ESs are
+ * - An ES can be simultaneously LOCAL and REMOTE; infact all LOCAL ESs are
* expected to have REMOTE ES peers.
*/
struct bgp_evpn_es {
@@ -101,7 +103,7 @@ struct bgp_evpn_es {
*/
struct listnode pend_es_listnode;
- /* [EVPNES_LOCAL] List of RDs for this ES (bgp_evpn_es_rd) */
+ /* [EVPNES_LOCAL] List of RDs for this ES (bgp_evpn_es_frag) */
struct list *es_frag_list;
struct bgp_evpn_es_frag *es_base_frag;
@@ -319,7 +321,6 @@ struct bgp_evpn_mh_info {
/* Enable ES consistency checking */
bool consistency_checking;
/* Use L3 NHGs for host routes in symmetric IRB */
- bool install_l3nhg;
bool host_routes_use_l3nhg;
/* Some vendors are not generating the EAD-per-EVI route. This knob
* can be turned off to activate a remote ES-PE when the EAD-per-ES
diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c
index 5f519e84ed..109de1efb2 100644
--- a/bgpd/bgp_evpn_vty.c
+++ b/bgpd/bgp_evpn_vty.c
@@ -3867,19 +3867,19 @@ DEFUN (bgp_evpn_advertise_type5,
if (!(afi == AFI_IP || afi == AFI_IP6)) {
vty_out(vty,
- "%%only ipv4 or ipv6 address families are supported\n");
+ "%% Only ipv4 or ipv6 address families are supported\n");
return CMD_WARNING;
}
if (safi != SAFI_UNICAST) {
vty_out(vty,
- "%%only ipv4 unicast or ipv6 unicast are supported\n");
+ "%% Only ipv4 unicast or ipv6 unicast are supported\n");
return CMD_WARNING;
}
if ((oly != OVERLAY_INDEX_TYPE_NONE)
&& (oly != OVERLAY_INDEX_GATEWAY_IP)) {
- vty_out(vty, "%%Unknown overlay-index type specified\n");
+ vty_out(vty, "%% Unknown overlay-index type specified\n");
return CMD_WARNING;
}
@@ -4058,13 +4058,13 @@ DEFUN (no_bgp_evpn_advertise_type5,
if (!(afi == AFI_IP || afi == AFI_IP6)) {
vty_out(vty,
- "%%only ipv4 or ipv6 address families are supported\n");
+ "%% Only ipv4 or ipv6 address families are supported\n");
return CMD_WARNING;
}
if (safi != SAFI_UNICAST) {
vty_out(vty,
- "%%only ipv4 unicast or ipv6 unicast are supported\n");
+ "%% Only ipv4 unicast or ipv6 unicast are supported\n");
return CMD_WARNING;
}
@@ -4495,7 +4495,7 @@ DEFPY(show_bgp_l2vpn_evpn_es,
if (esi_str) {
if (!str_to_esi(esi_str, &esi)) {
- vty_out(vty, "%%Malformed ESI\n");
+ vty_out(vty, "%% Malformed ESI\n");
return CMD_WARNING;
}
bgp_evpn_es_show_esi(vty, &esi, uj);
@@ -4517,7 +4517,7 @@ DEFPY(show_bgp_l2vpn_evpn_es_vrf, show_bgp_l2vpn_evpn_es_vrf_cmd,
if (esi_str) {
if (!str_to_esi(esi_str, &esi)) {
- vty_out(vty, "%%Malformed ESI\n");
+ vty_out(vty, "%% Malformed ESI\n");
return CMD_WARNING;
}
bgp_evpn_es_vrf_show_esi(vty, &esi, uj);
@@ -5132,7 +5132,7 @@ DEFPY_HIDDEN(
if (esi_str) {
if (!str_to_esi(esi_str, &esi)) {
- vty_out(vty, "%%Malformed ESI\n");
+ vty_out(vty, "%% Malformed ESI\n");
return CMD_WARNING;
}
esi_p = &esi;
@@ -5165,7 +5165,7 @@ DEFPY_HIDDEN(
if (esi_str) {
if (!str_to_esi(esi_str, &esi)) {
- vty_out(vty, "%%Malformed ESI\n");
+ vty_out(vty, "%% Malformed ESI\n");
return CMD_WARNING;
}
esi_p = &esi;
@@ -5267,19 +5267,19 @@ DEFPY_HIDDEN(test_es_add,
bgp = bgp_get_evpn();
if (!bgp) {
- vty_out(vty, "%%EVPN BGP instance not yet created\n");
+ vty_out(vty, "%% EVPN BGP instance not yet created\n");
return CMD_WARNING;
}
if (!str_to_esi(esi_str, &esi)) {
- vty_out(vty, "%%Malformed ESI\n");
+ vty_out(vty, "%% Malformed ESI\n");
return CMD_WARNING;
}
if (no) {
ret = bgp_evpn_local_es_del(bgp, &esi);
if (ret == -1) {
- vty_out(vty, "%%Failed to delete ES\n");
+ vty_out(vty, "%% Failed to delete ES\n");
return CMD_WARNING;
}
} else {
@@ -5292,7 +5292,7 @@ DEFPY_HIDDEN(test_es_add,
ret = bgp_evpn_local_es_add(bgp, &esi, vtep_ip, oper_up,
EVPN_MH_DF_PREF_MIN, false);
if (ret == -1) {
- vty_out(vty, "%%Failed to add ES\n");
+ vty_out(vty, "%% Failed to add ES\n");
return CMD_WARNING;
}
}
@@ -5316,25 +5316,25 @@ DEFPY_HIDDEN(test_es_vni_add,
bgp = bgp_get_evpn();
if (!bgp) {
- vty_out(vty, "%%EVPN BGP instance not yet created\n");
+ vty_out(vty, "%% EVPN BGP instance not yet created\n");
return CMD_WARNING;
}
if (!str_to_esi(esi_str, &esi)) {
- vty_out(vty, "%%Malformed ESI\n");
+ vty_out(vty, "%% Malformed ESI\n");
return CMD_WARNING;
}
if (no) {
ret = bgp_evpn_local_es_evi_del(bgp, &esi, vni);
if (ret == -1) {
- vty_out(vty, "%%Failed to deref ES VNI\n");
+ vty_out(vty, "%% Failed to deref ES VNI\n");
return CMD_WARNING;
}
} else {
ret = bgp_evpn_local_es_evi_add(bgp, &esi, vni);
if (ret == -1) {
- vty_out(vty, "%%Failed to ref ES VNI\n");
+ vty_out(vty, "%% Failed to ref ES VNI\n");
return CMD_WARNING;
}
}
@@ -5747,9 +5747,13 @@ DEFUN (show_bgp_vrf_l3vni_info,
name = argv[idx_vrf]->arg;
bgp = bgp_lookup_by_name(name);
+ if (strmatch(name, VRF_DEFAULT_NAME))
+ bgp = bgp_get_default();
+
if (!bgp) {
if (!uj)
- vty_out(vty, "BGP instance for VRF %s not found", name);
+ vty_out(vty, "BGP instance for VRF %s not found\n",
+ name);
else {
json_object_string_add(json, "warning",
"BGP instance not found");
diff --git a/bgpd/bgp_lcommunity.c b/bgpd/bgp_lcommunity.c
index 8720170013..e0cca50d89 100644
--- a/bgpd/bgp_lcommunity.c
+++ b/bgpd/bgp_lcommunity.c
@@ -103,7 +103,7 @@ static bool lcommunity_add_val(struct lcommunity *lcom,
return true;
}
-/* This function takes pointer to Large Communites strucutre then
+/* This function takes pointer to Large Communites structure then
create a new Large Communities structure by uniq and sort each
Large Communities value. */
struct lcommunity *lcommunity_uniq_sort(struct lcommunity *lcom)
diff --git a/bgpd/bgp_mpath.c b/bgpd/bgp_mpath.c
index 6e695d0301..6cd6ddd9dd 100644
--- a/bgpd/bgp_mpath.c
+++ b/bgpd/bgp_mpath.c
@@ -905,18 +905,12 @@ void bgp_path_info_mpath_aggregate_update(struct bgp_path_info *new_best,
attr.aspath = aspath;
attr.origin = origin;
- if (community) {
+ if (community)
bgp_attr_set_community(&attr, community);
- attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES);
- }
- if (ecomm) {
+ if (ecomm)
bgp_attr_set_ecommunity(&attr, ecomm);
- attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
- }
- if (lcomm) {
+ if (lcomm)
bgp_attr_set_lcommunity(&attr, lcomm);
- attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES);
- }
/* Zap multipath attr nexthop so we set nexthop to self */
attr.nexthop.s_addr = INADDR_ANY;
diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c
index 08a68d0c12..b3d8d1b82d 100644
--- a/bgpd/bgp_mplsvpn.c
+++ b/bgpd/bgp_mplsvpn.c
@@ -516,28 +516,35 @@ static bool sid_exist(struct bgp *bgp, const struct in6_addr *sid)
}
/*
+ * This function generates a new SID based on bgp->srv6_locator_chunks and
+ * index. The locator and generated SID are stored in arguments sid_locator
+ * and sid, respectively.
+ *
* if index != 0: try to allocate as index-mode
* else: try to allocate as auto-mode
*/
static uint32_t alloc_new_sid(struct bgp *bgp, uint32_t index,
- struct in6_addr *sid_locator)
+ struct in6_addr *sid_locator,
+ struct in6_addr *sid)
{
struct listnode *node;
struct srv6_locator_chunk *chunk;
- struct in6_addr sid_buf;
bool alloced = false;
int label = 0;
+ uint8_t offset = 0;
- if (!bgp || !sid_locator)
+ if (!bgp || !sid_locator || !sid)
return false;
for (ALL_LIST_ELEMENTS_RO(bgp->srv6_locator_chunks, node, chunk)) {
*sid_locator = chunk->prefix.prefix;
- sid_buf = chunk->prefix.prefix;
+ *sid = chunk->prefix.prefix;
+ offset = chunk->block_bits_length + chunk->node_bits_length;
+
if (index != 0) {
label = index << 12;
- transpose_sid(&sid_buf, label, 64, 16);
- if (sid_exist(bgp, &sid_buf))
+ transpose_sid(sid, label, offset, 16);
+ if (sid_exist(bgp, sid))
return false;
alloced = true;
break;
@@ -545,8 +552,8 @@ static uint32_t alloc_new_sid(struct bgp *bgp, uint32_t index,
for (size_t i = 1; i < 255; i++) {
label = i << 12;
- transpose_sid(&sid_buf, label, 64, 16);
- if (sid_exist(bgp, &sid_buf))
+ transpose_sid(sid, label, offset, 16);
+ if (sid_exist(bgp, sid))
continue;
alloced = true;
break;
@@ -556,7 +563,7 @@ static uint32_t alloc_new_sid(struct bgp *bgp, uint32_t index,
if (!alloced)
return 0;
- sid_register(bgp, &sid_buf, bgp->srv6_locator_name);
+ sid_register(bgp, sid, bgp->srv6_locator_name);
return label;
}
@@ -600,20 +607,19 @@ void ensure_vrf_tovpn_sid(struct bgp *bgp_vpn, struct bgp *bgp_vrf, afi_t afi)
tovpn_sid_locator =
XCALLOC(MTYPE_BGP_SRV6_SID, sizeof(struct in6_addr));
- tovpn_sid_transpose_label =
- alloc_new_sid(bgp_vpn, tovpn_sid_index, tovpn_sid_locator);
+ tovpn_sid = XCALLOC(MTYPE_BGP_SRV6_SID, sizeof(struct in6_addr));
+
+ tovpn_sid_transpose_label = alloc_new_sid(bgp_vpn, tovpn_sid_index,
+ tovpn_sid_locator, tovpn_sid);
+
if (tovpn_sid_transpose_label == 0) {
zlog_debug("%s: not allocated new sid for vrf %s: afi %s",
__func__, bgp_vrf->name_pretty, afi2str(afi));
+ XFREE(MTYPE_BGP_SRV6_SID, tovpn_sid_locator);
+ XFREE(MTYPE_BGP_SRV6_SID, tovpn_sid);
return;
}
- tovpn_sid = XCALLOC(MTYPE_BGP_SRV6_SID, sizeof(struct in6_addr));
- *tovpn_sid = *tovpn_sid_locator;
- transpose_sid(tovpn_sid, tovpn_sid_transpose_label,
- BGP_PREFIX_SID_SRV6_TRANSPOSITION_OFFSET,
- BGP_PREFIX_SID_SRV6_TRANSPOSITION_LENGTH);
-
if (debug) {
inet_ntop(AF_INET6, tovpn_sid, buf, sizeof(buf));
zlog_debug("%s: new sid %s allocated for vrf %s: afi %s",
@@ -1147,7 +1153,6 @@ void vpn_leak_from_vrf_update(struct bgp *bgp_vpn, /* to */
.rtlist[BGP_VPN_POLICY_DIR_TOVPN]);
}
bgp_attr_set_ecommunity(&static_attr, new_ecom);
- SET_FLAG(static_attr.flag, ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES));
if (debug && bgp_attr_get_ecommunity(&static_attr)) {
char *s = ecommunity_ecom2str(
@@ -1511,8 +1516,6 @@ vpn_leak_to_vrf_update_onevrf(struct bgp *bgp_vrf, /* to */
bgp_attr_set_ecommunity(&static_attr, new_ecom);
if (new_ecom->size == 0) {
- UNSET_FLAG(static_attr.flag,
- ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES));
ecommunity_free(&new_ecom);
bgp_attr_set_ecommunity(&static_attr, NULL);
}
@@ -1924,7 +1927,7 @@ void vpn_handle_router_id_update(struct bgp *bgp, bool withdraw,
struct bgp *bgp_import;
struct listnode *node;
struct ecommunity *ecom;
- vpn_policy_direction_t idir, edir;
+ enum vpn_policy_direction idir, edir;
/*
* Router-id change that is not explicitly configured
@@ -2037,7 +2040,7 @@ void vrf_import_from_vrf(struct bgp *to_bgp, struct bgp *from_bgp,
afi_t afi, safi_t safi)
{
const char *export_name;
- vpn_policy_direction_t idir, edir;
+ enum vpn_policy_direction idir, edir;
char *vname, *tmp_name;
char buf[RD_ADDRSTRLEN];
struct ecommunity *ecom;
@@ -2166,7 +2169,7 @@ void vrf_unimport_from_vrf(struct bgp *to_bgp, struct bgp *from_bgp,
afi_t afi, safi_t safi)
{
const char *export_name, *tmp_name;
- vpn_policy_direction_t idir, edir;
+ enum vpn_policy_direction idir, edir;
char *vname;
struct ecommunity *ecom = NULL;
struct listnode *node;
@@ -3089,7 +3092,7 @@ void bgp_vpn_leak_export(struct bgp *from_bgp)
char *vname;
struct listnode *node, *next;
struct ecommunity *ecom;
- vpn_policy_direction_t idir, edir;
+ enum vpn_policy_direction idir, edir;
safi_t safi = SAFI_UNICAST;
struct bgp *to_bgp;
int debug;
diff --git a/bgpd/bgp_mplsvpn.h b/bgpd/bgp_mplsvpn.h
index 5bf772fefe..8c2eae279c 100644
--- a/bgpd/bgp_mplsvpn.h
+++ b/bgpd/bgp_mplsvpn.h
@@ -205,7 +205,7 @@ static inline int vpn_leak_from_vpn_active(struct bgp *bgp_vrf, afi_t afi,
return 1;
}
-static inline void vpn_leak_prechange(vpn_policy_direction_t direction,
+static inline void vpn_leak_prechange(enum vpn_policy_direction direction,
afi_t afi, struct bgp *bgp_vpn,
struct bgp *bgp_vrf)
{
@@ -225,7 +225,7 @@ static inline void vpn_leak_prechange(vpn_policy_direction_t direction,
}
}
-static inline void vpn_leak_postchange(vpn_policy_direction_t direction,
+static inline void vpn_leak_postchange(enum vpn_policy_direction direction,
afi_t afi, struct bgp *bgp_vpn,
struct bgp *bgp_vrf)
{
diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c
index d3ebc0e6a2..dc4f30a906 100644
--- a/bgpd/bgp_nht.c
+++ b/bgpd/bgp_nht.c
@@ -323,7 +323,7 @@ int bgp_find_or_add_nexthop(struct bgp *bgp_route, struct bgp *bgp_nexthop,
pi->extra->igpmetric = 0;
} else if (peer) {
/*
- * Let's not accidently save the peer data for a peer
+ * Let's not accidentally save the peer data for a peer
* we are going to throw away in a second or so.
* When we come back around we'll fix up this
* data properly in replace_nexthop_by_peer
@@ -589,6 +589,10 @@ static void bgp_nht_ifp_handle(struct interface *ifp, bool up)
if (!bgp)
return;
+ bgp_nht_ifp_table_handle(bgp, &bgp->nexthop_cache_table[AFI_IP], ifp,
+ up);
+ bgp_nht_ifp_table_handle(bgp, &bgp->import_check_table[AFI_IP], ifp,
+ up);
bgp_nht_ifp_table_handle(bgp, &bgp->nexthop_cache_table[AFI_IP6], ifp,
up);
bgp_nht_ifp_table_handle(bgp, &bgp->import_check_table[AFI_IP6], ifp,
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
index 8b8fcf58c0..b0d852ee63 100644
--- a/bgpd/bgp_packet.c
+++ b/bgpd/bgp_packet.c
@@ -1679,7 +1679,7 @@ static int bgp_update_receive(struct peer *peer, bgp_size_t size)
*
* Complicates the flow a little though..
*/
- bgp_attr_parse_ret_t attr_parse_ret = BGP_ATTR_PARSE_PROCEED;
+ enum bgp_attr_parse_ret attr_parse_ret = BGP_ATTR_PARSE_PROCEED;
/* This define morphs the update case into a withdraw when lower levels
* have signalled an error condition where this is best.
*/
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index a5a57bdc7f..7e2cb5c70c 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -565,8 +565,8 @@ static int bgp_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new,
{
const struct prefix *new_p;
struct attr *newattr, *existattr;
- bgp_peer_sort_t new_sort;
- bgp_peer_sort_t exist_sort;
+ enum bgp_peer_sort new_sort;
+ enum bgp_peer_sort exist_sort;
uint32_t new_pref;
uint32_t exist_pref;
uint32_t new_med;
@@ -1253,10 +1253,10 @@ static int bgp_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new,
}
}
- /* 13. Router-ID comparision. */
+ /* 13. Router-ID comparison. */
/* If one of the paths is "stale", the corresponding peer router-id will
* be 0 and would always win over the other path. If originator id is
- * used for the comparision, it will decide which path is better.
+ * used for the comparison, it will decide which path is better.
*/
if (newattr->flag & ATTR_FLAG_BIT(BGP_ATTR_ORIGINATOR_ID))
new_id.s_addr = newattr->originator_id.s_addr;
@@ -1285,7 +1285,7 @@ static int bgp_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new,
return 0;
}
- /* 14. Cluster length comparision. */
+ /* 14. Cluster length comparison. */
new_cluster = BGP_CLUSTER_LIST_LENGTH(new->attr);
exist_cluster = BGP_CLUSTER_LIST_LENGTH(exist->attr);
@@ -1309,7 +1309,7 @@ static int bgp_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new,
return 0;
}
- /* 15. Neighbor address comparision. */
+ /* 15. Neighbor address comparison. */
/* Do this only if neither path is "stale" as stale paths do not have
* valid peer information (as the connection may or may not be up).
*/
@@ -1598,7 +1598,7 @@ static int bgp_input_modifier(struct peer *peer, const struct prefix *p,
/* Route map apply. */
if (rmap) {
memset(&rmap_path, 0, sizeof(struct bgp_path_info));
- /* Duplicate current value to new strucutre for modification. */
+ /* Duplicate current value to new structure for modification. */
rmap_path.peer = peer;
rmap_path.attr = attr;
rmap_path.extra = &extra;
@@ -1655,7 +1655,7 @@ static int bgp_output_modifier(struct peer *peer, const struct prefix *p,
memset(&rmap_path, 0, sizeof(struct bgp_path_info));
/* Route map apply. */
- /* Duplicate current value to new strucutre for modification. */
+ /* Duplicate current value to new structure for modification. */
rmap_path.peer = peer;
rmap_path.attr = attr;
@@ -1769,7 +1769,6 @@ void bgp_attr_add_llgr_community(struct attr *attr)
community_free(&llgr);
bgp_attr_set_community(attr, new);
- attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES);
}
void bgp_attr_add_gshut_community(struct attr *attr)
@@ -1798,7 +1797,6 @@ void bgp_attr_add_gshut_community(struct attr *attr)
community_free(&gshut);
bgp_attr_set_community(attr, new);
- attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES);
/* When we add the graceful-shutdown community we must also
* lower the local-preference */
@@ -3711,7 +3709,6 @@ static void bgp_attr_add_no_export_community(struct attr *attr)
community_free(&no_export);
bgp_attr_set_community(attr, new);
- attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES);
}
int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
@@ -8189,14 +8186,16 @@ DEFPY(aggregate_addressv4, aggregate_addressv4_cmd,
"[no] aggregate-address <A.B.C.D/M$prefix|A.B.C.D$addr A.B.C.D$mask> [{"
"as-set$as_set_s"
"|summary-only$summary_only"
- "|route-map WORD$rmap_name"
+ "|route-map RMAP_NAME$rmap_name"
"|origin <egp|igp|incomplete>$origin_s"
"|matching-MED-only$match_med"
- "|suppress-map WORD$suppress_map"
+ "|suppress-map RMAP_NAME$suppress_map"
"}]",
NO_STR
"Configure BGP aggregate entries\n"
- "Aggregate prefix\n" "Aggregate address\n" "Aggregate mask\n"
+ "Aggregate prefix\n"
+ "Aggregate address\n"
+ "Aggregate mask\n"
"Generate AS set path information\n"
"Filter more specific routes from updates\n"
"Apply route map to aggregate network\n"
@@ -8251,10 +8250,10 @@ DEFPY(aggregate_addressv6, aggregate_addressv6_cmd,
"[no] aggregate-address X:X::X:X/M$prefix [{"
"as-set$as_set_s"
"|summary-only$summary_only"
- "|route-map WORD$rmap_name"
+ "|route-map RMAP_NAME$rmap_name"
"|origin <egp|igp|incomplete>$origin_s"
"|matching-MED-only$match_med"
- "|suppress-map WORD$suppress_map"
+ "|suppress-map RMAP_NAME$suppress_map"
"}]",
NO_STR
"Configure BGP aggregate entries\n"
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index 2ed73ddb68..6c303a9e5f 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -2199,7 +2199,6 @@ route_set_community(void *rule, const struct prefix *prefix, void *object)
/* "none" case. */
if (rcs->none) {
- attr->flag &= ~(ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES));
bgp_attr_set_community(attr, NULL);
/* See the longer comment down below. */
if (old && old->refcnt == 0)
@@ -2227,8 +2226,6 @@ route_set_community(void *rule, const struct prefix *prefix, void *object)
/* will be interned by caller if required */
bgp_attr_set_community(attr, new);
- attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES);
-
return RMAP_OKAY;
}
@@ -2313,7 +2310,6 @@ route_set_lcommunity(void *rule, const struct prefix *prefix, void *object)
/* "none" case. */
if (rcs->none) {
- attr->flag &= ~(ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES));
bgp_attr_set_lcommunity(attr, NULL);
/* See the longer comment down below. */
@@ -2341,8 +2337,6 @@ route_set_lcommunity(void *rule, const struct prefix *prefix, void *object)
/* will be intern()'d or attr_flush()'d by bgp_update_main() */
bgp_attr_set_lcommunity(attr, new);
- attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES);
-
return RMAP_OKAY;
}
@@ -2438,13 +2432,9 @@ route_set_lcommunity_delete(void *rule, const struct prefix *pfx, void *object)
if (new->size == 0) {
bgp_attr_set_lcommunity(path->attr, NULL);
- path->attr->flag &=
- ~ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES);
lcommunity_free(&new);
} else {
bgp_attr_set_lcommunity(path->attr, new);
- path->attr->flag |=
- ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES);
}
}
@@ -2526,12 +2516,9 @@ route_set_community_delete(void *rule, const struct prefix *prefix,
if (new->size == 0) {
bgp_attr_set_community(path->attr, NULL);
- path->attr->flag &=
- ~ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES);
community_free(&new);
} else {
bgp_attr_set_community(path->attr, new);
- path->attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES);
}
}
@@ -2597,7 +2584,6 @@ route_set_ecommunity(void *rule, const struct prefix *prefix, void *object)
attr = path->attr;
if (rcs->none) {
- attr->flag &= ~(ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES));
bgp_attr_set_ecommunity(attr, NULL);
return RMAP_OKAY;
}
@@ -2624,8 +2610,6 @@ route_set_ecommunity(void *rule, const struct prefix *prefix, void *object)
/* will be intern()'d or attr_flush()'d by bgp_update_main() */
bgp_attr_set_ecommunity(path->attr, new_ecom);
- path->attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
-
return RMAP_OKAY;
}
@@ -2787,7 +2771,6 @@ route_set_ecommunity_lb(void *rule, const struct prefix *prefix, void *object)
/* new_ecom will be intern()'d or attr_flush()'d in call stack */
bgp_attr_set_ecommunity(path->attr, new_ecom);
- path->attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
/* Mark that route-map has set link bandwidth; used in attribute
* setting decisions.
@@ -3809,6 +3792,14 @@ static void bgp_route_map_update_peer_group(const char *rmap_name,
if (filter->usmap.name
&& (strcmp(rmap_name, filter->usmap.name) == 0))
filter->usmap.map = map;
+
+ if (filter->advmap.aname &&
+ (strcmp(rmap_name, filter->advmap.aname) == 0))
+ filter->advmap.amap = map;
+
+ if (filter->advmap.cname &&
+ (strcmp(rmap_name, filter->advmap.cname) == 0))
+ filter->advmap.cmap = map;
}
}
}
diff --git a/bgpd/bgp_updgrp.c b/bgpd/bgp_updgrp.c
index aa3e44318a..e85118e588 100644
--- a/bgpd/bgp_updgrp.c
+++ b/bgpd/bgp_updgrp.c
@@ -1463,7 +1463,7 @@ static int update_group_periodic_merge_walkcb(struct update_group *updgrp,
* over multiple statements. Useful to set dirty flag on
* update groups.
*/
-void update_group_policy_update(struct bgp *bgp, bgp_policy_type_e ptype,
+void update_group_policy_update(struct bgp *bgp, enum bgp_policy_type ptype,
const char *pname, int route_update,
int start_event)
{
diff --git a/bgpd/bgp_updgrp.h b/bgpd/bgp_updgrp.h
index 0e10341bc4..e3309ab7c5 100644
--- a/bgpd/bgp_updgrp.h
+++ b/bgpd/bgp_updgrp.h
@@ -74,7 +74,7 @@
| PEER_CAP_ADDPATH_AF_TX_ADV | PEER_CAP_ADDPATH_AF_RX_RCV \
| PEER_CAP_ENHE_AF_NEGO)
-typedef enum { BGP_ATTR_VEC_NH = 0, BGP_ATTR_VEC_MAX } bpacket_attr_vec_type;
+enum bpacket_attr_vec_type { BGP_ATTR_VEC_NH = 0, BGP_ATTR_VEC_MAX };
typedef struct {
uint32_t flags;
@@ -288,7 +288,7 @@ struct updwalk_context {
struct bgp_path_info *pi;
uint64_t updgrp_id;
uint64_t subgrp_id;
- bgp_policy_type_e policy_type;
+ enum bgp_policy_type policy_type;
const char *policy_name;
int policy_event_start_flag;
int policy_route_update;
@@ -368,7 +368,8 @@ extern void update_subgroup_split_peer(struct peer_af *, struct update_group *);
extern bool update_subgroup_check_merge(struct update_subgroup *, const char *);
extern bool update_subgroup_trigger_merge_check(struct update_subgroup *,
int force);
-extern void update_group_policy_update(struct bgp *bgp, bgp_policy_type_e ptype,
+extern void update_group_policy_update(struct bgp *bgp,
+ enum bgp_policy_type ptype,
const char *pname, int route_update,
int start_event);
extern void update_group_af_walk(struct bgp *bgp, afi_t afi, safi_t safi,
@@ -409,7 +410,7 @@ extern struct stream *bpacket_reformat_for_peer(struct bpacket *pkt,
struct peer_af *paf);
extern void bpacket_attr_vec_arr_reset(struct bpacket_attr_vec_arr *vecarr);
extern void bpacket_attr_vec_arr_set_vec(struct bpacket_attr_vec_arr *vecarr,
- bpacket_attr_vec_type type,
+ enum bpacket_attr_vec_type type,
struct stream *s, struct attr *attr);
extern void subgroup_default_update_packet(struct update_subgroup *subgrp,
struct attr *attr,
diff --git a/bgpd/bgp_updgrp_adv.c b/bgpd/bgp_updgrp_adv.c
index 0d8ee79ae5..87558f9c35 100644
--- a/bgpd/bgp_updgrp_adv.c
+++ b/bgpd/bgp_updgrp_adv.c
@@ -818,6 +818,8 @@ void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw)
assert(attr.aspath);
attr.local_pref = bgp->default_local_pref;
+ attr.med = 0;
+ attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC);
if ((afi == AFI_IP6) || peer_cap_enhe(peer, afi, safi)) {
/* IPv6 global nexthop must be included. */
diff --git a/bgpd/bgp_updgrp_packet.c b/bgpd/bgp_updgrp_packet.c
index cf24e1d689..c4a3ca7500 100644
--- a/bgpd/bgp_updgrp_packet.c
+++ b/bgpd/bgp_updgrp_packet.c
@@ -1240,7 +1240,7 @@ void subgroup_default_withdraw_packet(struct update_subgroup *subgrp)
static void
bpacket_vec_arr_inherit_attr_flags(struct bpacket_attr_vec_arr *vecarr,
- bpacket_attr_vec_type type,
+ enum bpacket_attr_vec_type type,
struct attr *attr)
{
if (CHECK_FLAG(attr->rmap_change_flags,
@@ -1291,8 +1291,8 @@ void bpacket_attr_vec_arr_reset(struct bpacket_attr_vec_arr *vecarr)
/* Setup a particular node entry in the vecarr */
void bpacket_attr_vec_arr_set_vec(struct bpacket_attr_vec_arr *vecarr,
- bpacket_attr_vec_type type, struct stream *s,
- struct attr *attr)
+ enum bpacket_attr_vec_type type,
+ struct stream *s, struct attr *attr)
{
if (!vecarr)
return;
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 7bed1d3f50..2aa77576a1 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -934,12 +934,12 @@ static void bgp_clear_vty_error(struct vty *vty, struct peer *peer, afi_t afi,
switch (error) {
case BGP_ERR_AF_UNCONFIGURED:
vty_out(vty,
- "%%BGP: Enable %s address family for the neighbor %s\n",
+ "%% BGP: Enable %s address family for the neighbor %s\n",
get_afi_safi_str(afi, safi, false), peer->host);
break;
case BGP_ERR_SOFT_RECONFIG_UNCONFIGURED:
vty_out(vty,
- "%%BGP: Inbound soft reconfig for %s not possible as it\n has neither refresh capability, nor inbound soft reconfig\n",
+ "%% BGP: Inbound soft reconfig for %s not possible as it\n has neither refresh capability, nor inbound soft reconfig\n",
peer->host);
break;
default:
@@ -1086,7 +1086,7 @@ static int bgp_clear(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
peer = peer_lookup(bgp, &su);
if (!peer) {
vty_out(vty,
- "%%BGP: Unknown neighbor - \"%s\"\n",
+ "%% BGP: Unknown neighbor - \"%s\"\n",
arg);
return CMD_WARNING;
}
@@ -1113,7 +1113,7 @@ static int bgp_clear(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
group = peer_group_lookup(bgp, arg);
if (!group) {
- vty_out(vty, "%%BGP: No such peer-group %s\n", arg);
+ vty_out(vty, "%% BGP: No such peer-group %s\n", arg);
return CMD_WARNING;
}
@@ -1128,7 +1128,7 @@ static int bgp_clear(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
if (!found)
vty_out(vty,
- "%%BGP: No %s peer belonging to peer-group %s is configured\n",
+ "%% BGP: No %s peer belonging to peer-group %s is configured\n",
get_afi_safi_str(afi, safi, false), arg);
return CMD_SUCCESS;
@@ -1163,7 +1163,7 @@ static int bgp_clear(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
if (!found)
vty_out(vty,
- "%%BGP: No external %s peer is configured\n",
+ "%% BGP: No external %s peer is configured\n",
get_afi_safi_str(afi, safi, false));
return CMD_SUCCESS;
@@ -1200,7 +1200,7 @@ static int bgp_clear(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
if (!found)
vty_out(vty,
- "%%BGP: No %s peer is configured with AS %s\n",
+ "%% BGP: No %s peer is configured with AS %s\n",
get_afi_safi_str(afi, safi, false), arg);
return CMD_SUCCESS;
@@ -8700,7 +8700,7 @@ DEFPY (af_rt_vpn_imexport,
int ret;
struct ecommunity *ecom = NULL;
int dodir[BGP_VPN_POLICY_DIR_MAX] = {0};
- vpn_policy_direction_t dir;
+ enum vpn_policy_direction dir;
afi_t afi;
int idx = 0;
bool yes = true;
@@ -8780,7 +8780,7 @@ DEFPY (af_route_map_vpn_imexport,
VTY_DECLVAR_CONTEXT(bgp, bgp);
int ret;
int dodir[BGP_VPN_POLICY_DIR_MAX] = {0};
- vpn_policy_direction_t dir;
+ enum vpn_policy_direction dir;
afi_t afi;
int idx = 0;
bool yes = true;
@@ -8843,7 +8843,7 @@ DEFPY(af_import_vrf_route_map, af_import_vrf_route_map_cmd,
"name of route-map\n")
{
VTY_DECLVAR_CONTEXT(bgp, bgp);
- vpn_policy_direction_t dir = BGP_VPN_POLICY_DIR_FROMVPN;
+ enum vpn_policy_direction dir = BGP_VPN_POLICY_DIR_FROMVPN;
afi_t afi;
struct bgp *bgp_default;
@@ -8896,7 +8896,7 @@ DEFPY(af_no_import_vrf_route_map, af_no_import_vrf_route_map_cmd,
"name of route-map\n")
{
VTY_DECLVAR_CONTEXT(bgp, bgp);
- vpn_policy_direction_t dir = BGP_VPN_POLICY_DIR_FROMVPN;
+ enum vpn_policy_direction dir = BGP_VPN_POLICY_DIR_FROMVPN;
afi_t afi;
afi = vpn_policy_getafi(vty, bgp, true);
@@ -9027,7 +9027,7 @@ DEFPY (bgp_imexport_vpn,
int idx = 0;
bool yes = true;
int flag;
- vpn_policy_direction_t dir;
+ enum vpn_policy_direction dir;
if (argv_find(argv, argc, "no", &idx))
yes = false;
@@ -14626,7 +14626,7 @@ static int bgp_show_route_leak_vty(struct vty *vty, const char *name,
char *vname;
char buf1[INET6_ADDRSTRLEN];
char *ecom_str;
- vpn_policy_direction_t dir;
+ enum vpn_policy_direction dir;
if (json) {
json_object *json_import_vrfs = NULL;
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index 6f06ad5a40..a2361758dc 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -565,7 +565,7 @@ void bgp_confederation_id_set(struct bgp *bgp, as_t as)
AS change. Just Reset EBGP sessions, not CONFED sessions. If we
were not doing confederation before, reset all EBGP sessions. */
for (ALL_LIST_ELEMENTS(bgp->peer, node, nnode, peer)) {
- bgp_peer_sort_t ptype = peer_sort(peer);
+ enum bgp_peer_sort ptype = peer_sort(peer);
/* We're looking for peers who's AS is not local or part of our
confederation. */
@@ -1004,7 +1004,7 @@ void peer_af_flag_inherit(struct peer *peer, afi_t afi, safi_t safi,
}
/* Check peer's AS number and determines if this peer is IBGP or EBGP */
-static inline bgp_peer_sort_t peer_calc_sort(struct peer *peer)
+static inline enum bgp_peer_sort peer_calc_sort(struct peer *peer)
{
struct bgp *bgp;
@@ -1091,13 +1091,13 @@ static inline bgp_peer_sort_t peer_calc_sort(struct peer *peer)
}
/* Calculate and cache the peer "sort" */
-bgp_peer_sort_t peer_sort(struct peer *peer)
+enum bgp_peer_sort peer_sort(struct peer *peer)
{
peer->sort = peer_calc_sort(peer);
return peer->sort;
}
-bgp_peer_sort_t peer_sort_lookup(struct peer *peer)
+enum bgp_peer_sort peer_sort_lookup(struct peer *peer)
{
return peer->sort;
}
@@ -1826,7 +1826,7 @@ int bgp_afi_safi_peer_exists(struct bgp *bgp, afi_t afi, safi_t safi)
/* Change peer's AS number. */
void peer_as_change(struct peer *peer, as_t as, int as_specified)
{
- bgp_peer_sort_t origtype, newtype;
+ enum bgp_peer_sort origtype, newtype;
/* Stop peer. */
if (!CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP)) {
@@ -1931,8 +1931,8 @@ int peer_remote_as(struct bgp *bgp, union sockunion *su, const char *conf_if,
return BGP_ERR_PEER_GROUP_MEMBER;
}
- bgp_peer_sort_t peer_sort_type =
- peer_sort(peer->group->conf);
+ enum bgp_peer_sort peer_sort_type =
+ peer_sort(peer->group->conf);
/* Explicit AS numbers used, compare AS numbers */
if (as_type == AS_SPECIFIED) {
@@ -2103,6 +2103,20 @@ static void peer_group2peer_config_copy_af(struct peer_group *group,
PEER_ATTR_INHERIT(peer, group, filter[afi][safi].usmap.map);
}
+ /* Conditional Advertisements */
+ if (!CHECK_FLAG(pfilter_ovrd[RMAP_OUT], PEER_FT_ADVERTISE_MAP)) {
+ PEER_STR_ATTR_INHERIT(peer, group,
+ filter[afi][safi].advmap.aname,
+ MTYPE_BGP_FILTER_NAME);
+ PEER_ATTR_INHERIT(peer, group, filter[afi][safi].advmap.amap);
+ PEER_STR_ATTR_INHERIT(peer, group,
+ filter[afi][safi].advmap.cname,
+ MTYPE_BGP_FILTER_NAME);
+ PEER_ATTR_INHERIT(peer, group, filter[afi][safi].advmap.cmap);
+ PEER_ATTR_INHERIT(peer, group,
+ filter[afi][safi].advmap.condition);
+ }
+
if (peer->addpath_type[afi][safi] == BGP_ADDPATH_NONE) {
peer->addpath_type[afi][safi] = conf->addpath_type[afi][safi];
bgp_addpath_type_changed(conf->bgp);
@@ -2898,7 +2912,7 @@ int peer_group_bind(struct bgp *bgp, union sockunion *su, struct peer *peer,
int first_member = 0;
afi_t afi;
safi_t safi;
- bgp_peer_sort_t ptype, gtype;
+ enum bgp_peer_sort ptype, gtype;
/* Lookup the peer. */
if (!peer)
@@ -3766,7 +3780,7 @@ void bgp_free(struct bgp *bgp)
XFREE(MTYPE_BGP_EVPN_INFO, bgp->evpn_info);
for (afi = AFI_IP; afi < AFI_MAX; afi++) {
- vpn_policy_direction_t dir;
+ enum vpn_policy_direction dir;
if (bgp->vpn_policy[afi].import_vrf)
list_delete(&bgp->vpn_policy[afi].import_vrf);
@@ -4542,7 +4556,7 @@ static int peer_af_flag_modify(struct peer *peer, afi_t afi, safi_t safi,
struct peer *member;
struct listnode *node, *nnode;
struct peer_flag_action action;
- bgp_peer_sort_t ptype;
+ enum bgp_peer_sort ptype;
memset(&action, 0, sizeof(struct peer_flag_action));
size = sizeof(peer_af_flag_action_list)
@@ -5909,7 +5923,7 @@ int peer_local_as_set(struct peer *peer, as_t as, bool no_prepend,
struct bgp *bgp = peer->bgp;
struct peer *member;
struct listnode *node, *nnode;
- bgp_peer_sort_t ptype = peer_sort(peer);
+ enum bgp_peer_sort ptype = peer_sort(peer);
if (ptype != BGP_PEER_EBGP && ptype != BGP_PEER_INTERNAL)
return BGP_ERR_LOCAL_AS_ALLOWED_ONLY_FOR_EBGP;
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h
index 360bcc39c4..dfed9f2ae9 100644
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -192,11 +192,11 @@ struct bgp_redist {
struct bgp_rmap rmap;
};
-typedef enum {
+enum vpn_policy_direction {
BGP_VPN_POLICY_DIR_FROMVPN = 0,
BGP_VPN_POLICY_DIR_TOVPN = 1,
BGP_VPN_POLICY_DIR_MAX = 2
-} vpn_policy_direction_t;
+};
struct vpn_policy {
struct bgp *bgp; /* parent */
@@ -901,13 +901,13 @@ struct bgp_filter {
/* IBGP/EBGP identifier. We also have a CONFED peer, which is to say,
a peer who's AS is part of our Confederation. */
-typedef enum {
+enum bgp_peer_sort {
BGP_PEER_UNSPECIFIED,
BGP_PEER_IBGP,
BGP_PEER_EBGP,
BGP_PEER_INTERNAL,
BGP_PEER_CONFED,
-} bgp_peer_sort_t;
+};
/* BGP message header and packet size. */
#define BGP_MARKER_SIZE 16
@@ -1084,7 +1084,7 @@ struct peer {
/* Peer's local AS number. */
as_t local_as;
- bgp_peer_sort_t sort;
+ enum bgp_peer_sort sort;
/* Peer's Change local AS number. */
as_t change_local_as;
@@ -1968,12 +1968,12 @@ enum bgp_create_error_code {
/*
* Enumeration of different policy kinds a peer can be configured with.
*/
-typedef enum {
+enum bgp_policy_type {
BGP_POLICY_ROUTE_MAP,
BGP_POLICY_FILTER_LIST,
BGP_POLICY_PREFIX_LIST,
BGP_POLICY_DISTRIBUTE_LIST,
-} bgp_policy_type_e;
+};
/* peer_flag_change_type. */
enum peer_change_type {
@@ -2025,8 +2025,8 @@ extern struct peer *peer_unlock_with_caller(const char *, struct peer *);
#define peer_unlock(A) peer_unlock_with_caller(__FUNCTION__, (A))
#define peer_lock(B) peer_lock_with_caller(__FUNCTION__, (B))
-extern bgp_peer_sort_t peer_sort(struct peer *peer);
-extern bgp_peer_sort_t peer_sort_lookup(struct peer *peer);
+extern enum bgp_peer_sort peer_sort(struct peer *peer);
+extern enum bgp_peer_sort peer_sort_lookup(struct peer *peer);
extern bool peer_active(struct peer *);
extern bool peer_active_nego(struct peer *);
diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c
index c96c321d76..3aa8868374 100644
--- a/bgpd/rfapi/rfapi.c
+++ b/bgpd/rfapi/rfapi.c
@@ -832,9 +832,7 @@ void add_vnc_route(struct rfapi_descriptor *rfd, /* cookie, VPN UN addr, peer */
struct ecommunity *ecomm = bgp_attr_get_ecommunity(&attr);
- if (ecomm->size) {
- attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
- } else {
+ if (!ecomm->size) {
ecommunity_free(&ecomm);
bgp_attr_set_ecommunity(&attr, NULL);
}
diff --git a/bgpd/rfapi/vnc_export_bgp.c b/bgpd/rfapi/vnc_export_bgp.c
index f4f2e11391..c479b4d65a 100644
--- a/bgpd/rfapi/vnc_export_bgp.c
+++ b/bgpd/rfapi/vnc_export_bgp.c
@@ -650,9 +650,6 @@ encap_attr_export(struct attr *new, struct attr *orig,
} else {
bgp_attr_set_ecommunity(new, ecom_ro);
}
- if (ecom_ro) {
- new->flag |= ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES);
- }
/*
* Set MED
diff --git a/configure.ac b/configure.ac
index c636fade70..a7698f484c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -58,7 +58,7 @@ elif test "$host" != "$build"; then
AC_MSG_NOTICE([...])
AC_MSG_NOTICE([... cross-compilation: creating hosttools directory and self-configuring for build platform tools])
- AC_MSG_NOTICE([... use HOST_CPPFLAGS / HOST_CFLAGS / HOST_LDFLAGS if neccessary])
+ AC_MSG_NOTICE([... use HOST_CPPFLAGS / HOST_CFLAGS / HOST_LDFLAGS if necessary])
AC_MSG_NOTICE([...])
(
diff --git a/debian/changelog b/debian/changelog
index 2b28c4c6dc..f3e42199de 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -989,7 +989,7 @@ quagga (0.98.3-6) testing-proposed-updates; urgency=high
quagga (0.98.3-5) unstable; urgency=high
* The patch which tried to remove the OpenSSL dependency, which is
- not only unneccessary but also a violation of the licence and thus RC,
+ not only unnecessary but also a violation of the licence and thus RC,
stopped working a while ago, since autoreconf is no longer run before
building the binaries. So now ./configure is patched directly (thanks
to Faidon Liambotis for reporting). Closes: #306840
@@ -1370,7 +1370,7 @@ quagga (0.96.4x-3) unstable; urgency=low
* Made the directory (but not the config/log files!) world accessible
again on user request (thanks to Anand Kumria)). Closes: #213129
* No longer providing sample configuration in /etc/quagga/. They are
- now only available in /usr/share/doc/quagga/ to avoid accidently
+ now only available in /usr/share/doc/quagga/ to avoid accidentally
using them without changing the adresses (thanks to Marc Haber).
Closes: #215918
@@ -1430,7 +1430,7 @@ quagga (0.96.3-1) unstable; urgency=medium
quagga (0.96.2-9) unstable; urgency=medium
- * Removed /usr/share/info/dir.* which were accidently there and prevented
+ * Removed /usr/share/info/dir.* which were accidentally there and prevented
the installation by dpkg (thanks to Simon Raven). Closes: #212614
* Reworded package description (thanks to Anand Kumria). Closes: #213125
* Added french debconf translation (thanks to Christian Perrier).
diff --git a/debian/frr.logrotate b/debian/frr.logrotate
index a56a908bdf..ea09c1bf87 100644
--- a/debian/frr.logrotate
+++ b/debian/frr.logrotate
@@ -17,7 +17,7 @@
# open, as well as the daemons, so always signal the daemons.
# It's safe, a NOP if (only) syslog is being used.
for i in babeld bgpd eigrpd isisd ldpd nhrpd ospf6d ospfd sharpd \
- pimd ripd ripngd zebra pbrd staticd bfdd fabricd vrrpd; do
+ pimd ripd ripngd zebra pathd pbrd staticd bfdd fabricd vrrpd; do
if [ -e /var/run/frr/$i.pid ] ; then
pids="$pids $(cat /var/run/frr/$i.pid)"
fi
diff --git a/debian/frr.preinst b/debian/frr.preinst
index 0e10e39247..2af5a4ed8f 100644
--- a/debian/frr.preinst
+++ b/debian/frr.preinst
@@ -73,6 +73,7 @@ EOF
-o -f /etc/frr/eigrpd.conf \
-o -f /etc/frr/babeld.conf \
-o -f /etc/frr/pbrd.conf \
+ -o -f /etc/frr/pathd.conf \
-o -f /etc/frr/bfdd.conf; then
# no explicit statement, but some split config file exists
# => need to fix vtysh.conf & frr.conf in postinst
diff --git a/doc/developer/building-frr-for-fedora.rst b/doc/developer/building-frr-for-fedora.rst
index dc869ece10..aa10f1118d 100644
--- a/doc/developer/building-frr-for-fedora.rst
+++ b/doc/developer/building-frr-for-fedora.rst
@@ -81,7 +81,7 @@ content:
MPLS must be invidividually enabled on each interface that requires it. See
the example in the config block above.
-Load the modifed sysctls on the system:
+Load the modified sysctls on the system:
.. code-block:: console
diff --git a/doc/developer/building-frr-for-opensuse.rst b/doc/developer/building-frr-for-opensuse.rst
index d9800a1638..38346fe881 100644
--- a/doc/developer/building-frr-for-opensuse.rst
+++ b/doc/developer/building-frr-for-opensuse.rst
@@ -85,7 +85,7 @@ content:
MPLS must be invidividually enabled on each interface that requires it. See
the example in the config block above.
-Load the modifed sysctls on the system:
+Load the modified sysctls on the system:
.. code-block:: console
diff --git a/doc/developer/lists.rst b/doc/developer/lists.rst
index 4eaa85115e..ccac10aab9 100644
--- a/doc/developer/lists.rst
+++ b/doc/developer/lists.rst
@@ -62,7 +62,7 @@ in the future:
The APIs are all designed to be as type-safe as possible. This means that
there will be a compiler warning when an item doesn't match the container, or
the return value has a different type, or other similar situations. **You
-should never use casts with these APIs.** If a cast is neccessary in relation
+should never use casts with these APIs.** If a cast is necessary in relation
to these APIs, there is probably something wrong with the overall design.
Only the following pieces use dynamically allocated memory:
@@ -143,7 +143,7 @@ Each of the data structures has a ``PREDECL_*`` and a ``DECLARE_*`` macro to
set up an "instantiation" of the container. This works somewhat similar to C++
templating, though much simpler.
-**In all following text, the Z prefix is replaced with a name choosen
+**In all following text, the Z prefix is replaced with a name chosen
for the instance of the datastructure.**
The common setup pattern will look like this:
@@ -650,7 +650,7 @@ Atomic lists
`atomlist.h` provides an unsorted and a sorted atomic single-linked list.
Since atomic memory accesses can be considerably slower than plain memory
accessses (depending on the CPU type), these lists should only be used where
-neccessary.
+necessary.
The following guarantees are provided regarding concurrent access:
diff --git a/doc/developer/static-linking.rst b/doc/developer/static-linking.rst
index 1e45c48dc3..5342fbfbf6 100644
--- a/doc/developer/static-linking.rst
+++ b/doc/developer/static-linking.rst
@@ -64,7 +64,7 @@ like this:
Hopefully you get a nice, usable, PIC ``libpcre.a``.
So now we have to link all these static libraries into FRR. Rather than modify
-FRR to accomodate this, the best option is to create an archive with all of
+FRR to accommodate this, the best option is to create an archive with all of
libyang's dependencies. Then to avoid making any changes to FRR build foo,
rename this ``libyang.a`` and copy it over the usual static library location.
Ugly but it works. To do this, go into your libyang build directory, which
diff --git a/doc/user/basic.rst b/doc/user/basic.rst
index ea4b3f41f3..42faefd10b 100644
--- a/doc/user/basic.rst
+++ b/doc/user/basic.rst
@@ -471,7 +471,7 @@ recommendations apply in regards to upgrades:
for differences against your old configuration. If any defaults changed
that affect your setup, lines may appear or disappear. If a new line
appears, it was previously the default (or not supported) and is now
- neccessary to retain previous behavior. If a line disappears, it
+ necessary to retain previous behavior. If a line disappears, it
previously wasn't the default, but now is, so it is no longer necessary.
3. Check the log files for deprecation warnings by using ``grep -i deprecat``.
diff --git a/doc/user/bfd.rst b/doc/user/bfd.rst
index 14aacc0f6b..c47ed04f63 100644
--- a/doc/user/bfd.rst
+++ b/doc/user/bfd.rst
@@ -236,7 +236,7 @@ BFD Peer Specific Commands
Notes:
- - Profile configurations can be overriden on a peer basis by specifying
+ - Profile configurations can be overridden on a peer basis by specifying
non-default parameters in peer configuration node.
- Non existing profiles can be configured and they will only be applied
once they start to exist.
diff --git a/doc/user/pimv6.rst b/doc/user/pimv6.rst
index e71cf4631c..f0946a13f7 100644
--- a/doc/user/pimv6.rst
+++ b/doc/user/pimv6.rst
@@ -113,6 +113,14 @@ Certain signals have special meanings to *pim6d*.
notifications to the kernel. This command is vrf aware, to configure for a
vrf, enter the vrf submode.
+.. clicmd:: ipv6 ssmpingd [X:X::X:X]
+
+ Enable ipv6 ssmpingd configuration. A network level management tool
+ to check whether one can receive multicast packets via SSM from host.
+ The host target given to ssmping must run the ssmpingd daemon which listens
+ for IPv4 and IPv6 unicast requests. When it receives one, it responds to a
+ well known SSM multicast group which ssmping just have joined.
+
.. _pimv6-interface-configuration:
PIMv6 Interface Configuration
diff --git a/doc/user/scripting.rst b/doc/user/scripting.rst
index badc82c500..42855de1ab 100644
--- a/doc/user/scripting.rst
+++ b/doc/user/scripting.rst
@@ -58,7 +58,7 @@ The documentation for :ref:`on-rib-process-dplane-results` tells us its
arguments. Here, the destination prefix for a route is being logged out.
Scripts live in :file:`/etc/frr/scripts/` by default. This is configurable at
-compile time via ``--with-scriptdir``. It may be overriden at runtime with the
+compile time via ``--with-scriptdir``. It may be overridden at runtime with the
``--scriptdir`` daemon option.
The documentation for :ref:`on-rib-process-dplane-results` indicates that the
diff --git a/doc/user/zebra.rst b/doc/user/zebra.rst
index cd220a4141..29f305520a 100644
--- a/doc/user/zebra.rst
+++ b/doc/user/zebra.rst
@@ -283,6 +283,17 @@ the default route.
Allow IPv6 nexthop tracking to resolve via the default route. This parameter
is configured per-VRF, so the command is also available in the VRF subnode.
+.. clicmd:: show ip nht [vrf NAME] [A.B.C.D|X:X::X:X] [mrib]
+
+ Show nexthop tracking status for address resolution. If vrf is not specified
+ then display the default vrf. If ``all`` is specified show all vrf address
+ resolution output. If an ipv4 or ipv6 address is not specified then display
+ all addresses tracked, else display the requested address. The mrib keyword
+ indicates that the operator wants to see the multicast rib address resolution
+ table. An alternative form of the command is ``show ip import-check`` and this
+ form of the command is deprecated at this point in time.
+
+
Administrative Distance
=======================
@@ -290,7 +301,7 @@ Administrative distance allows FRR to make decisions about what routes
should be installed in the rib based upon the originating protocol.
The lowest Admin Distance is the route selected. This is purely a
subjective decision about ordering and care has been taken to choose
-the same distances that other routing suites have choosen.
+the same distances that other routing suites have chosen.
+------------+-----------+
| Protocol | Distance |
@@ -350,7 +361,7 @@ has multiple routes for the same prefix from multiple sources. An example
here would be if someone else was running another routing suite besides
FRR at the same time, the kernel must choose what route to use to forward
on. FRR choose the value of 20 because of two reasons. FRR wanted a
-value small enough to be choosen but large enough that the operator could
+value small enough to be chosen but large enough that the operator could
allow route prioritization by the kernel when multiple routing suites are
being run and FRR wanted to take advantage of Route Replace semantics that
the linux kernel offers. In order for Route Replacement semantics to
@@ -541,7 +552,7 @@ via a ``ip route show X`` command:
nexthop via 192.168.161.9 dev enp39s0 weight 1
Once installed into the FIB, FRR currently has little control over what
-nexthops are choosen to forward packets on. Currently the Linux kernel
+nexthops are chosen to forward packets on. Currently the Linux kernel
has a ``fib_multipath_hash_policy`` sysctl which dictates how the hashing
algorithm is used to forward packets.
@@ -1182,7 +1193,7 @@ zebra Terminal Mode Commands
Display statistics about clients that are connected to zebra. This is
useful for debugging and seeing how much data is being passed between
- zebra and it's clients. If the summary form of the command is choosen
+ zebra and it's clients. If the summary form of the command is chosen
a table is displayed with shortened information.
.. clicmd:: show zebra router table summary
diff --git a/isisd/isis_adjacency.c b/isisd/isis_adjacency.c
index 2729dce382..11f17ec7bf 100644
--- a/isisd/isis_adjacency.c
+++ b/isisd/isis_adjacency.c
@@ -31,6 +31,7 @@
#include "thread.h"
#include "if.h"
#include "stream.h"
+#include "bfd.h"
#include "isisd/isis_constants.h"
#include "isisd/isis_common.h"
@@ -814,6 +815,15 @@ void isis_adj_print_vty(struct isis_adjacency *adj, struct vty *vty,
vty_out(vty, " %s\n", buf);
}
}
+ if (adj->circuit && adj->circuit->bfd_config.enabled) {
+ vty_out(vty, " BFD is %s%s\n",
+ adj->bfd_session ? "active, status "
+ : "configured",
+ !adj->bfd_session
+ ? ""
+ : bfd_get_status_str(bfd_sess_status(
+ adj->bfd_session)));
+ }
for (ALL_LIST_ELEMENTS_RO(adj->adj_sids, anode, sra)) {
const char *adj_type;
const char *backup;
diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c
index c7bf1e2012..fedceed3bb 100644
--- a/isisd/isis_circuit.c
+++ b/isisd/isis_circuit.c
@@ -661,8 +661,11 @@ int isis_circuit_up(struct isis_circuit *circuit)
"Interface MTU %zu on %s is too low to support area lsp mtu %u!",
isis_circuit_pdu_size(circuit),
circuit->interface->name, circuit->area->lsp_mtu);
- isis_circuit_update_all_srmflags(circuit, 0);
- return ISIS_ERROR;
+
+ /* Allow ISIS to continue configuration. With this
+ * configuration failure ISIS will attempt to send lsp
+ * packets but will fail until the mtu is configured properly
+ */
}
if (circuit->circ_type == CIRCUIT_T_BROADCAST) {
diff --git a/isisd/isis_ldp_sync.c b/isisd/isis_ldp_sync.c
index 3c68b8d15f..fb605eb07a 100644
--- a/isisd/isis_ldp_sync.c
+++ b/isisd/isis_ldp_sync.c
@@ -479,9 +479,9 @@ void isis_if_ldp_sync_enable(struct isis_circuit *circuit)
struct isis_area *area = circuit->area;
/* called when setting LDP-SYNC at the global level:
- * specifed on interface overrides global config
+ * specified on interface overrides global config
* if ptop link send msg to LDP indicating ldp-sync enabled
- */
+ */
if (if_is_loopback(circuit->interface))
return;
@@ -541,7 +541,7 @@ void isis_if_set_ldp_sync_holddown(struct isis_circuit *circuit)
struct isis_area *area = circuit->area;
/* called when setting LDP-SYNC at the global level:
- * specifed on interface overrides global config.
+ * specified on interface overrides global config.
*/
if (if_is_loopback(circuit->interface))
return;
diff --git a/isisd/isis_nb_config.c b/isisd/isis_nb_config.c
index de7797813a..cf4c2aea0a 100644
--- a/isisd/isis_nb_config.c
+++ b/isisd/isis_nb_config.c
@@ -393,30 +393,11 @@ int isis_instance_purge_originator_modify(struct nb_cb_modify_args *args)
*/
int isis_instance_lsp_mtu_modify(struct nb_cb_modify_args *args)
{
- struct listnode *node;
- struct isis_circuit *circuit;
uint16_t lsp_mtu = yang_dnode_get_uint16(args->dnode, NULL);
struct isis_area *area;
switch (args->event) {
case NB_EV_VALIDATE:
- area = nb_running_get_entry(args->dnode, NULL, false);
- if (!area)
- break;
- for (ALL_LIST_ELEMENTS_RO(area->circuit_list, node, circuit)) {
- if (circuit->state != C_STATE_INIT
- && circuit->state != C_STATE_UP)
- continue;
- if (lsp_mtu > isis_circuit_pdu_size(circuit)) {
- snprintf(
- args->errmsg, args->errmsg_len,
- "ISIS area contains circuit %s, which has a maximum PDU size of %zu",
- circuit->interface->name,
- isis_circuit_pdu_size(circuit));
- return NB_ERR_VALIDATION;
- }
- }
- break;
case NB_EV_PREPARE:
case NB_EV_ABORT:
break;
@@ -2552,43 +2533,14 @@ int isis_instance_mpls_ldp_sync_holddown_modify(struct nb_cb_modify_args *args)
*/
int lib_interface_isis_create(struct nb_cb_create_args *args)
{
- struct isis_area *area = NULL;
struct interface *ifp;
struct isis_circuit *circuit = NULL;
const char *area_tag = yang_dnode_get_string(args->dnode, "./area-tag");
- uint32_t min_mtu, actual_mtu;
switch (args->event) {
case NB_EV_PREPARE:
case NB_EV_ABORT:
- break;
case NB_EV_VALIDATE:
- /* check if interface mtu is sufficient. If the area has not
- * been created yet, assume default MTU for the area
- */
- ifp = nb_running_get_entry(args->dnode, NULL, false);
- /* zebra might not know yet about the MTU - nothing we can do */
- if (!ifp || ifp->mtu == 0)
- break;
- actual_mtu =
- if_is_broadcast(ifp) ? ifp->mtu - LLC_LEN : ifp->mtu;
-
- area = isis_area_lookup(area_tag, ifp->vrf->vrf_id);
- if (area)
- min_mtu = area->lsp_mtu;
- else
-#ifndef FABRICD
- min_mtu = yang_get_default_uint16(
- "/frr-isisd:isis/instance/lsp/mtu");
-#else
- min_mtu = DEFAULT_LSP_MTU;
-#endif /* ifndef FABRICD */
- if (actual_mtu < min_mtu) {
- snprintf(args->errmsg, args->errmsg_len,
- "Interface %s has MTU %u, minimum MTU for the area is %u",
- ifp->name, actual_mtu, min_mtu);
- return NB_ERR_VALIDATION;
- }
break;
case NB_EV_APPLY:
ifp = nb_running_get_entry(args->dnode, NULL, true);
diff --git a/isisd/isis_pdu.c b/isisd/isis_pdu.c
index 1a54d47f3c..016efd5cd7 100644
--- a/isisd/isis_pdu.c
+++ b/isisd/isis_pdu.c
@@ -2103,7 +2103,7 @@ void send_hello_sched(struct isis_circuit *circuit, int level, long delay)
/*
- * Count the maximum number of lsps that can be accomodated by a given size.
+ * Count the maximum number of lsps that can be accommodated by a given size.
*/
#define LSP_ENTRIES_LEN (10 + ISIS_SYS_ID_LEN)
static uint16_t get_max_lsp_count(uint16_t size)
diff --git a/isisd/isis_pdu.h b/isisd/isis_pdu.h
index b2e43781f6..b4018995d5 100644
--- a/isisd/isis_pdu.h
+++ b/isisd/isis_pdu.h
@@ -142,7 +142,7 @@ struct isis_lsp_hdr {
/*
* Since the length field of LSP Entries TLV is one byte long, and each LSP
* entry is LSP_ENTRIES_LEN (16) bytes long, the maximum number of LSP entries
- * can be accomodated in a TLV is
+ * can be accommodated in a TLV is
* 255 / 16 = 15.
*
* Therefore, the maximum length of the LSP Entries TLV is
diff --git a/isisd/isis_route.c b/isisd/isis_route.c
index 764a0b0cd3..9f8f639e5d 100644
--- a/isisd/isis_route.c
+++ b/isisd/isis_route.c
@@ -443,7 +443,7 @@ void isis_route_delete(struct isis_area *area, struct route_node *rode,
if (rinfo == NULL) {
if (IS_DEBUG_RTE_EVENTS)
zlog_debug(
- "ISIS-Rte: tried to delete non-existant route %s",
+ "ISIS-Rte: tried to delete non-existent route %s",
buff);
return;
}
diff --git a/ldpd/ldpd.c b/ldpd/ldpd.c
index a78d2b25d6..796cf11798 100644
--- a/ldpd/ldpd.c
+++ b/ldpd/ldpd.c
@@ -1790,7 +1790,7 @@ merge_l2vpn(struct ldpd_conf *xconf, struct l2vpn *l2vpn, struct l2vpn *xl)
previous_pw_type = l2vpn->pw_type;
previous_mtu = l2vpn->mtu;
- /* merge intefaces */
+ /* merge interfaces */
RB_FOREACH_SAFE(lif, l2vpn_if_head, &l2vpn->if_tree, ftmp) {
/* find deleted interfaces */
if (l2vpn_if_find(xl, lif->ifname) == NULL) {
diff --git a/lib/atomlist.c b/lib/atomlist.c
index b7c9516a00..2631d4fa78 100644
--- a/lib/atomlist.c
+++ b/lib/atomlist.c
@@ -267,7 +267,7 @@ static void atomsort_del_core(struct atomsort_head *h,
memory_order_consume);
/* track the beginning of a chain of deleted items
- * this is neccessary to make this lock-free; we can
+ * this is necessary to make this lock-free; we can
* complete deletions started by other threads.
*/
if (!atomptr_l(prevval)) {
diff --git a/lib/privs.c b/lib/privs.c
index b3f51267d1..24a15a0c0b 100644
--- a/lib/privs.c
+++ b/lib/privs.c
@@ -684,7 +684,7 @@ void zprivs_init(struct zebra_privs_t *zprivs)
#else /* !HAVE_CAPABILITIES */
/* we dont have caps. we'll need to maintain rid and saved uid
- * and change euid back to saved uid (who we presume has all neccessary
+ * and change euid back to saved uid (who we presume has all necessary
* privileges) whenever we are asked to raise our privileges.
*
* This is not worth that much security wise, but all we can do.
diff --git a/lib/route_types.txt b/lib/route_types.txt
index 77639070c9..a82273a6dc 100644
--- a/lib/route_types.txt
+++ b/lib/route_types.txt
@@ -3,7 +3,7 @@
# Used to construct route_types.c and route_types.h
#
# comma-seperated fields of either 2 fields (help strings) or 7 fields.
-# White space before and after the comma seperators is stripped.
+# White space before and after the comma separators is stripped.
# Lines /beginning/ with # are comments.
#
####
diff --git a/lib/subdir.am b/lib/subdir.am
index d1df9cb3d9..c3899c4e0f 100644
--- a/lib/subdir.am
+++ b/lib/subdir.am
@@ -588,7 +588,7 @@ DISTCLEANFILES += lib/route_types.h
if GIT_VERSION
# bit of a trick here to always have up-to-date git stamps without triggering
-# unneccessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
+# unnecessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
# but if we use that on gitversion.h it'll ripple through the .c file deps.
# (even if gitversion.h's file timestamp doesn't change, make will think it
# did, because of .PHONY...)
diff --git a/ospf6d/ospf6_flood.c b/ospf6d/ospf6_flood.c
index cc82084e5e..bc9e2c3405 100644
--- a/ospf6d/ospf6_flood.c
+++ b/ospf6d/ospf6_flood.c
@@ -878,6 +878,28 @@ static int ospf6_is_maxage_lsa_drop(struct ospf6_lsa *lsa,
return 0;
}
+static bool ospf6_lsa_check_min_arrival(struct ospf6_lsa *lsa,
+ struct ospf6_neighbor *from)
+{
+ struct timeval now, res;
+ unsigned int time_delta_ms;
+
+ monotime(&now);
+ timersub(&now, &lsa->installed, &res);
+ time_delta_ms = (res.tv_sec * 1000) + (int)(res.tv_usec / 1000);
+
+ if (time_delta_ms < from->ospf6_if->area->ospf6->lsa_minarrival) {
+ if (IS_OSPF6_DEBUG_FLOODING ||
+ IS_OSPF6_DEBUG_FLOOD_TYPE(lsa->header->type))
+ zlog_debug(
+ "LSA can't be updated within MinLSArrival, %dms < %dms, discard",
+ time_delta_ms,
+ from->ospf6_if->area->ospf6->lsa_minarrival);
+ return true;
+ }
+ return false;
+}
+
/* RFC2328 section 13 The Flooding Procedure */
void ospf6_receive_lsa(struct ospf6_neighbor *from,
struct ospf6_lsa_header *lsa_header)
@@ -885,7 +907,6 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from,
struct ospf6_lsa *new = NULL, *old = NULL, *rem = NULL;
int ismore_recent;
int is_debug = 0;
- unsigned int time_delta_ms;
ismore_recent = 1;
assert(from);
@@ -993,19 +1014,7 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from,
/* (a) MinLSArrival check */
if (old) {
- struct timeval now, res;
- monotime(&now);
- timersub(&now, &old->installed, &res);
- time_delta_ms =
- (res.tv_sec * 1000) + (int)(res.tv_usec / 1000);
- if (time_delta_ms
- < from->ospf6_if->area->ospf6->lsa_minarrival) {
- if (is_debug)
- zlog_debug(
- "LSA can't be updated within MinLSArrival, %dms < %dms, discard",
- time_delta_ms,
- from->ospf6_if->area->ospf6
- ->lsa_minarrival);
+ if (ospf6_lsa_check_min_arrival(old, from)) {
ospf6_lsa_delete(new);
return; /* examin next lsa */
}
@@ -1222,7 +1231,11 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from,
__PRETTY_FUNCTION__, old->name);
}
- /* XXX, MinLSArrival check !? RFC 2328 13 (8) */
+ /* MinLSArrival check as per RFC 2328 13 (8) */
+ if (ospf6_lsa_check_min_arrival(old, from)) {
+ ospf6_lsa_delete(new);
+ return; /* examin next lsa */
+ }
ospf6_lsdb_add(ospf6_lsa_copy(old),
from->lsupdate_list);
diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c
index b9ee3c3403..55f1a1c7b5 100644
--- a/ospf6d/ospf6_interface.c
+++ b/ospf6d/ospf6_interface.c
@@ -158,7 +158,7 @@ static uint32_t ospf6_interface_get_cost(struct ospf6_interface *oi)
ospf6 = oi->interface->vrf->info;
refbw = ospf6 ? ospf6->ref_bandwidth : OSPF6_REFERENCE_BANDWIDTH;
- /* A specifed ip ospf cost overrides a calculated one. */
+ /* A specified ip ospf cost overrides a calculated one. */
if (CHECK_FLAG(oi->flag, OSPF6_INTERFACE_NOAUTOCOST))
cost = oi->cost;
else {
diff --git a/ospf6d/ospf6_lsdb.h b/ospf6d/ospf6_lsdb.h
index 07c331af64..a3a4d5bb9f 100644
--- a/ospf6d/ospf6_lsdb.h
+++ b/ospf6d/ospf6_lsdb.h
@@ -71,7 +71,7 @@ extern struct ospf6_lsa *ospf6_lsdb_next(const struct route_node *iterend,
* Since we are locking the lsa in ospf6_lsdb_head
* and then unlocking it in ospf6_lsa_unlock, when
* we cache the next pointer we need to increment
- * the lock for the lsa so we don't accidently free
+ * the lock for the lsa so we don't accidentally free
* it really early.
*/
#define ALL_LSDB(lsdb, lsa, lsanext) \
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index 2626cccc37..5df2ecf070 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -102,7 +102,7 @@ int ospf_if_get_output_cost(struct ospf_interface *oi)
: OSPF_DEFAULT_BANDWIDTH;
refbw = oi->ospf->ref_bandwidth;
- /* A specifed ip ospf cost overrides a calculated one. */
+ /* A specified ip ospf cost overrides a calculated one. */
if (OSPF_IF_PARAM_CONFIGURED(IF_DEF_PARAMS(oi->ifp), output_cost_cmd)
|| OSPF_IF_PARAM_CONFIGURED(oi->params, output_cost_cmd))
cost = OSPF_IF_PARAM(oi, output_cost_cmd);
diff --git a/ospfd/ospf_ldp_sync.c b/ospfd/ospf_ldp_sync.c
index f6c1b43610..b4d770d48a 100644
--- a/ospfd/ospf_ldp_sync.c
+++ b/ospfd/ospf_ldp_sync.c
@@ -141,7 +141,7 @@ void ospf_ldp_sync_if_init(struct ospf_interface *oi)
ldp_sync_info = params->ldp_sync_info;
- /* specifed on interface overrides global config. */
+ /* specified on interface overrides global config. */
if (!CHECK_FLAG(ldp_sync_info->flags, LDP_SYNC_FLAG_HOLDDOWN))
ldp_sync_info->holddown = oi->ospf->ldp_sync_cmd.holddown;
@@ -441,7 +441,7 @@ void ospf_if_set_ldp_sync_enable(struct ospf *ospf, struct interface *ifp)
struct ldp_sync_info *ldp_sync_info;
/* called when setting LDP-SYNC at the global level:
- * specifed on interface overrides global config
+ * specified on interface overrides global config
* if ptop link send msg to LDP indicating ldp-sync enabled
*/
if (if_is_loopback(ifp))
@@ -479,7 +479,7 @@ void ospf_if_set_ldp_sync_holddown(struct ospf *ospf, struct interface *ifp)
struct ldp_sync_info *ldp_sync_info;
/* called when setting LDP-SYNC at the global level:
- * specifed on interface overrides global config.
+ * specified on interface overrides global config.
*/
if (if_is_loopback(ifp))
return;
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c
index 3ad7ca7d1b..59e1b73d24 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -450,7 +450,7 @@ char link_info_set(struct stream **s, struct in_addr id, struct in_addr data,
/* LSA stream is initially allocated to OSPF_MAX_LSA_SIZE, suits
* vast majority of cases. Some rare routers with lots of links need
* more.
- * we try accomodate those here.
+ * we try accommodate those here.
*/
if (STREAM_WRITEABLE(*s) < OSPF_ROUTER_LSA_LINK_SIZE) {
size_t ret = OSPF_MAX_LSA_SIZE;
@@ -2858,7 +2858,7 @@ struct ospf_lsa *ospf_lsa_install(struct ospf *ospf, struct ospf_interface *oi,
update is needed */
old = ospf_lsdb_lookup(lsdb, lsa);
- /* Do comparision and record if recalc needed. */
+ /* Do comparison and record if recalc needed. */
rt_recalc = 0;
if (old == NULL || ospf_lsa_different(old, lsa, false)) {
/* Ref rfc3623 section 3.2.3
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index c2bd7a0796..55a010a293 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -3515,7 +3515,7 @@ static int ospf_make_ls_req_func(struct stream *s, uint16_t *length,
/* LS Request packet overflows interface MTU
* delta is just number of bytes required for 1 LS Req
* ospf_packet_max will return the number of bytes can
- * be accomodated without ospf header. So length+delta
+ * be accommodated without ospf header. So length+delta
* can be compared to ospf_packet_max
* to check if it can fit another lsreq in the same packet.
*/
@@ -3601,7 +3601,7 @@ static int ospf_make_ls_upd(struct ospf_interface *oi, struct list *update,
zlog_debug("%s: List Iteration %d LSA[%s]", __func__,
count, dump_lsa_key(lsa));
- /* Will it fit? Minimum it has to fit atleast one */
+ /* Will it fit? Minimum it has to fit at least one */
if ((length + delta + ntohs(lsa->data->length) > size_noauth) &&
(count > 0))
break;
@@ -3649,7 +3649,7 @@ static int ospf_make_ls_ack(struct ospf_interface *oi, struct list *ack,
/* LS Ack packet overflows interface MTU
* delta is just number of bytes required for
* 1 LS Ack(1 LS Hdr) ospf_packet_max will return
- * the number of bytes can be accomodated without
+ * the number of bytes can be accommodated without
* ospf header. So length+delta can be compared
* against ospf_packet_max to check if it can fit
* another ls header in the same packet.
@@ -3966,7 +3966,7 @@ void ospf_ls_upd_send_lsa(struct ospf_neighbor *nbr, struct ospf_lsa *lsa,
list_delete(&update);
}
-/* Determine size for packet. Must be at least big enough to accomodate next
+/* Determine size for packet. Must be at least big enough to accommodate next
* LSA on list, which may be bigger than MTU size.
*
* Return pointer to new ospf_packet
diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c
index f763400212..baf02365a2 100644
--- a/ospfd/ospf_spf.c
+++ b/ospfd/ospf_spf.c
@@ -678,7 +678,7 @@ static void ospf_spf_flush_parents(struct vertex *w)
/*
* Consider supplied next-hop for inclusion to the supplied list of
- * equal-cost next-hops, adjust list as neccessary.
+ * equal-cost next-hops, adjust list as necessary.
*/
static void ospf_spf_add_parent(struct vertex *v, struct vertex *w,
struct vertex_nexthop *newhop,
diff --git a/pimd/pim6_cmd.c b/pimd/pim6_cmd.c
index 5d7a63372f..ce26f912f4 100644
--- a/pimd/pim6_cmd.c
+++ b/pimd/pim6_cmd.c
@@ -170,7 +170,7 @@ DEFPY (ipv6_pim_rp_keep_alive,
"ipv6 pim rp keep-alive-timer (1-65535)$kat",
IPV6_STR
PIM_STR
- "Rendevous Point\n"
+ "Rendezvous Point\n"
"Keep alive Timer\n"
"Seconds\n")
{
@@ -183,7 +183,7 @@ DEFPY (no_ipv6_pim_rp_keep_alive,
NO_STR
IPV6_STR
PIM_STR
- "Rendevous Point\n"
+ "Rendezvous Point\n"
"Keep alive Timer\n"
IGNORED_IN_NO_STR)
{
@@ -451,6 +451,33 @@ DEFPY (no_ipv6_pim_rp_prefix_list,
return pim_process_no_rp_plist_cmd(vty, rp_str, plist);
}
+
+DEFPY (ipv6_ssmpingd,
+ ipv6_ssmpingd_cmd,
+ "ipv6 ssmpingd [X:X::X:X]$source",
+ IPV6_STR
+ CONF_SSMPINGD_STR
+ "Source address\n")
+{
+ const char *src_str = (source_str) ? source_str : "::";
+
+ return pim_process_ssmpingd_cmd(vty, NB_OP_CREATE, src_str);
+}
+
+
+DEFPY (no_ipv6_ssmpingd,
+ no_ipv6_ssmpingd_cmd,
+ "no ipv6 ssmpingd [X:X::X:X]$source",
+ NO_STR
+ IPV6_STR
+ CONF_SSMPINGD_STR
+ "Source address\n")
+{
+ const char *src_str = (source_str) ? source_str : "::";
+
+ return pim_process_ssmpingd_cmd(vty, NB_OP_DESTROY, src_str);
+}
+
DEFPY (interface_ipv6_mld_join,
interface_ipv6_mld_join_cmd,
"ipv6 mld join X:X::X:X$group [X:X::X:X$source]",
@@ -1588,6 +1615,10 @@ void pim_cmd_init(void)
install_element(VRF_NODE, &ipv6_pim_rp_prefix_list_cmd);
install_element(CONFIG_NODE, &no_ipv6_pim_rp_prefix_list_cmd);
install_element(VRF_NODE, &no_ipv6_pim_rp_prefix_list_cmd);
+ install_element(CONFIG_NODE, &ipv6_ssmpingd_cmd);
+ install_element(VRF_NODE, &ipv6_ssmpingd_cmd);
+ install_element(CONFIG_NODE, &no_ipv6_ssmpingd_cmd);
+ install_element(VRF_NODE, &no_ipv6_ssmpingd_cmd);
install_element(INTERFACE_NODE, &interface_ipv6_mld_cmd);
install_element(INTERFACE_NODE, &interface_no_ipv6_mld_cmd);
install_element(INTERFACE_NODE, &interface_ipv6_mld_join_cmd);
diff --git a/pimd/pim6_cmd.h b/pimd/pim6_cmd.h
index ac5eb3f9bf..d6853a7410 100644
--- a/pimd/pim6_cmd.h
+++ b/pimd/pim6_cmd.h
@@ -43,6 +43,7 @@
#define DEBUG_MLD_EVENTS_STR "MLD protocol events\n"
#define DEBUG_MLD_PACKETS_STR "MLD protocol packets\n"
#define DEBUG_MLD_TRACE_STR "MLD internal daemon activity\n"
+#define CONF_SSMPINGD_STR "Enable ssmpingd operation\n"
void pim_cmd_init(void);
diff --git a/pimd/pim_bsm.c b/pimd/pim_bsm.c
index 0e91773be7..003ce47432 100644
--- a/pimd/pim_bsm.c
+++ b/pimd/pim_bsm.c
@@ -849,9 +849,9 @@ static bool pim_bsm_frag_send(uint8_t *buf, uint32_t len, struct interface *ifp,
this_pkt_rem = pim_mtu - (PIM_BSM_HDR_LEN
+ PIM_MSG_HEADER_LEN);
- /* If pkt can't accomodate next group + atleast
- * one rp, we must break out of this inner loop
- * and process next RP
+ /* If pkt can't accommodate next group + at
+ * least one rp, we must break out of this inner
+ * loop and process next RP
*/
if (total_rp_cnt == this_rp_cnt)
break;
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index ad5194a953..9d95408cbe 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -4909,7 +4909,7 @@ DEFPY (ip_pim_rp_keep_alive,
"ip pim rp keep-alive-timer (1-65535)$kat",
IP_STR
"pim multicast routing\n"
- "Rendevous Point\n"
+ "Rendezvous Point\n"
"Keep alive Timer\n"
"Seconds\n")
{
@@ -4922,7 +4922,7 @@ DEFUN (no_ip_pim_rp_keep_alive,
NO_STR
IP_STR
"pim multicast routing\n"
- "Rendevous Point\n"
+ "Rendezvous Point\n"
"Keep alive Timer\n"
IGNORED_IN_NO_STR)
{
@@ -5062,7 +5062,7 @@ DEFPY (ip_pim_rp,
"ip pim rp A.B.C.D$rp [A.B.C.D/M]$gp",
IP_STR
"pim multicast routing\n"
- "Rendevous Point\n"
+ "Rendezvous Point\n"
"ip address of RP\n"
"Group Address range to cover\n")
{
@@ -5090,7 +5090,7 @@ DEFPY (no_ip_pim_rp,
NO_STR
IP_STR
"pim multicast routing\n"
- "Rendevous Point\n"
+ "Rendezvous Point\n"
"ip address of RP\n"
"Group Address range to cover\n")
{
@@ -5314,24 +5314,9 @@ DEFUN (ip_ssmpingd,
"Source address\n")
{
int idx_ipv4 = 2;
- const char *source_str = (argc == 3) ? argv[idx_ipv4]->arg : "0.0.0.0";
- const char *vrfname;
- char ssmpingd_ip_xpath[XPATH_MAXLEN];
-
- vrfname = pim_cli_get_vrf_name(vty);
- if (vrfname == NULL)
- return CMD_WARNING_CONFIG_FAILED;
-
- snprintf(ssmpingd_ip_xpath, sizeof(ssmpingd_ip_xpath),
- FRR_PIM_VRF_XPATH,
- "frr-pim:pimd", "pim", vrfname, "frr-routing:ipv4");
- strlcat(ssmpingd_ip_xpath, "/ssm-pingd-source-ip",
- sizeof(ssmpingd_ip_xpath));
-
- nb_cli_enqueue_change(vty, ssmpingd_ip_xpath, NB_OP_CREATE,
- source_str);
+ const char *src_str = (argc == 3) ? argv[idx_ipv4]->arg : "0.0.0.0";
- return nb_cli_apply_changes(vty, NULL);
+ return pim_process_ssmpingd_cmd(vty, NB_OP_CREATE, src_str);
}
DEFUN (no_ip_ssmpingd,
@@ -5342,25 +5327,10 @@ DEFUN (no_ip_ssmpingd,
CONF_SSMPINGD_STR
"Source address\n")
{
- const char *vrfname;
int idx_ipv4 = 3;
- const char *source_str = (argc == 4) ? argv[idx_ipv4]->arg : "0.0.0.0";
- char ssmpingd_ip_xpath[XPATH_MAXLEN];
-
- vrfname = pim_cli_get_vrf_name(vty);
- if (vrfname == NULL)
- return CMD_WARNING_CONFIG_FAILED;
+ const char *src_str = (argc == 4) ? argv[idx_ipv4]->arg : "0.0.0.0";
- snprintf(ssmpingd_ip_xpath, sizeof(ssmpingd_ip_xpath),
- FRR_PIM_VRF_XPATH,
- "frr-pim:pimd", "pim", vrfname, "frr-routing:ipv4");
- strlcat(ssmpingd_ip_xpath, "/ssm-pingd-source-ip",
- sizeof(ssmpingd_ip_xpath));
-
- nb_cli_enqueue_change(vty, ssmpingd_ip_xpath, NB_OP_DESTROY,
- source_str);
-
- return nb_cli_apply_changes(vty, NULL);
+ return pim_process_ssmpingd_cmd(vty, NB_OP_DESTROY, src_str);
}
DEFUN (ip_pim_ecmp,
diff --git a/pimd/pim_cmd_common.c b/pimd/pim_cmd_common.c
index b7da8481fe..f7cd0dceab 100644
--- a/pimd/pim_cmd_common.c
+++ b/pimd/pim_cmd_common.c
@@ -2840,3 +2840,25 @@ int gm_process_no_last_member_query_interval_cmd(struct vty *vty)
return nb_cli_apply_changes(vty, FRR_GMP_INTERFACE_XPATH,
FRR_PIM_AF_XPATH_VAL);
}
+
+
+int pim_process_ssmpingd_cmd(struct vty *vty, enum nb_operation operation,
+ const char *src_str)
+{
+ const char *vrfname;
+ char ssmpingd_ip_xpath[XPATH_MAXLEN];
+
+ vrfname = pim_cli_get_vrf_name(vty);
+ if (vrfname == NULL)
+ return CMD_WARNING_CONFIG_FAILED;
+
+ snprintf(ssmpingd_ip_xpath, sizeof(ssmpingd_ip_xpath),
+ FRR_PIM_VRF_XPATH, "frr-pim:pimd", "pim", vrfname,
+ FRR_PIM_AF_XPATH_VAL);
+ strlcat(ssmpingd_ip_xpath, "/ssm-pingd-source-ip",
+ sizeof(ssmpingd_ip_xpath));
+
+ nb_cli_enqueue_change(vty, ssmpingd_ip_xpath, operation, src_str);
+
+ return nb_cli_apply_changes(vty, NULL);
+}
diff --git a/pimd/pim_cmd_common.h b/pimd/pim_cmd_common.h
index 3bcd0d5d6d..f5e0ef5878 100644
--- a/pimd/pim_cmd_common.h
+++ b/pimd/pim_cmd_common.h
@@ -102,6 +102,8 @@ int gm_process_no_last_member_query_count_cmd(struct vty *vty);
int gm_process_last_member_query_interval_cmd(struct vty *vty,
const char *lmqi_str);
int gm_process_no_last_member_query_interval_cmd(struct vty *vty);
+int pim_process_ssmpingd_cmd(struct vty *vty, enum nb_operation operation,
+ const char *src_str);
/*
* Special Macro to allow us to get the correct pim_instance
*/
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index f75293fdb7..b98e64adfe 100644
--- a/pimd/pim_iface.c
+++ b/pimd/pim_iface.c
@@ -1525,7 +1525,7 @@ void pim_if_update_assert_tracking_desired(struct interface *ifp)
/*
* PIM wants to have an interface pointer for everything it does.
* The pimreg is a special interface that we have that is not
- * quite an inteface but a VIF is created for it.
+ * quite an interface but a VIF is created for it.
*/
void pim_if_create_pimreg(struct pim_instance *pim)
{
diff --git a/pimd/pim_igmp.c b/pimd/pim_igmp.c
index 8f81dbc23a..0dce8faa90 100644
--- a/pimd/pim_igmp.c
+++ b/pimd/pim_igmp.c
@@ -668,7 +668,7 @@ static int igmp_v1_recv_report(struct gm_sock *igmp, struct in_addr from,
if (pim_is_group_filtered(ifp->info, &group_addr))
return -1;
- /* non-existant group is created as INCLUDE {empty} */
+ /* non-existent group is created as INCLUDE {empty} */
group = igmp_add_group_by_addr(igmp, group_addr);
if (!group) {
return -1;
diff --git a/pimd/pim_igmpv3.c b/pimd/pim_igmpv3.c
index fb9b385338..933b43cd98 100644
--- a/pimd/pim_igmpv3.c
+++ b/pimd/pim_igmpv3.c
@@ -516,7 +516,7 @@ static void allow(struct gm_sock *igmp, struct in_addr from,
return;
}
- /* non-existant group is created as INCLUDE {empty} */
+ /* non-existent group is created as INCLUDE {empty} */
group = igmp_add_group_by_addr(igmp, group_addr);
if (!group) {
return;
@@ -669,7 +669,7 @@ void igmpv3_report_isex(struct gm_sock *igmp, struct in_addr from,
if (pim_is_group_filtered(ifp->info, &group_addr))
return;
- /* non-existant group is created as INCLUDE {empty} */
+ /* non-existent group is created as INCLUDE {empty} */
group = igmp_add_group_by_addr(igmp, group_addr);
if (!group) {
return;
@@ -790,7 +790,7 @@ void igmpv3_report_toin(struct gm_sock *igmp, struct in_addr from,
* entry is present, the request is ignored.
*/
if (num_sources) {
- /* non-existant group is created as INCLUDE {empty} */
+ /* non-existent group is created as INCLUDE {empty} */
group = igmp_add_group_by_addr(igmp, group_addr);
if (!group) {
return;
@@ -944,7 +944,7 @@ void igmpv3_report_toex(struct gm_sock *igmp, struct in_addr from,
on_trace(__func__, ifp, from, group_addr, num_sources, sources);
- /* non-existant group is created as INCLUDE {empty} */
+ /* non-existent group is created as INCLUDE {empty} */
group = igmp_add_group_by_addr(igmp, group_addr);
if (!group) {
return;
@@ -1465,7 +1465,7 @@ void igmpv3_report_block(struct gm_sock *igmp, struct in_addr from,
on_trace(__func__, ifp, from, group_addr, num_sources, sources);
- /* non-existant group is created as INCLUDE {empty} */
+ /* non-existent group is created as INCLUDE {empty} */
group = igmp_add_group_by_addr(igmp, group_addr);
if (!group) {
return;
diff --git a/pimd/pim_mlag.c b/pimd/pim_mlag.c
index 68f77ad6d9..9763a79a8d 100644
--- a/pimd/pim_mlag.c
+++ b/pimd/pim_mlag.c
@@ -1015,7 +1015,7 @@ void pim_if_configure_mlag_dualactive(struct pim_interface *pim_ifp)
if (router->pim_mlag_intf_cnt == 1) {
/*
- * atleast one Interface is configured for MLAG, send register
+ * at least one Interface is configured for MLAG, send register
* to Zebra for receiving MLAG Updates
*/
pim_mlag_register();
diff --git a/pimd/pim_ssmpingd.c b/pimd/pim_ssmpingd.c
index afa7e37da1..d86be85bd8 100644
--- a/pimd/pim_ssmpingd.c
+++ b/pimd/pim_ssmpingd.c
@@ -361,10 +361,8 @@ int pim_ssmpingd_start(struct pim_instance *pim, pim_addr source_addr)
return 0;
}
- {
- zlog_info("%s: starting ssmpingd for source %pPAs", __func__,
- &source_addr);
- }
+ zlog_info("%s: starting ssmpingd for source %pPAs", __func__,
+ &source_addr);
ss = ssmpingd_new(pim, source_addr);
if (!ss) {
diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c
index b360181f43..b0db6b4d96 100644
--- a/pimd/pim_vty.c
+++ b/pimd/pim_vty.c
@@ -264,8 +264,8 @@ int pim_global_config_write_worker(struct pim_instance *pim, struct vty *vty)
struct ssmpingd_sock *ss;
++writes;
for (ALL_LIST_ELEMENTS_RO(pim->ssmpingd_list, node, ss)) {
- vty_out(vty, "%sip ssmpingd %pPA\n", spaces,
- &ss->source_addr);
+ vty_out(vty, "%s" PIM_AF_NAME " ssmpingd %pPA\n",
+ spaces, &ss->source_addr);
++writes;
}
}
diff --git a/redhat/frr.logrotate b/redhat/frr.logrotate
index 22b2332b7c..04ae96b654 100644
--- a/redhat/frr.logrotate
+++ b/redhat/frr.logrotate
@@ -110,6 +110,14 @@
endscript
}
+/var/log/frr/pathd.log {
+ notifempty
+ missingok
+ postrotate
+ /bin/kill -USR1 `cat /var/run/frr/pathd.pid 2> /dev/null` 2> /dev/null || true
+ endscript
+}
+
/var/log/frr/pbrd.log {
notifempty
missingok
diff --git a/redhat/frr.spec.in b/redhat/frr.spec.in
index 740cfe498a..9756bfbbdd 100644
--- a/redhat/frr.spec.in
+++ b/redhat/frr.spec.in
@@ -260,7 +260,7 @@ Group: System Environment/Daemons
Requires: %{name} = %{version}-%{release}
%description devel
-The frr-devel package contains the header and object files neccessary for
+The frr-devel package contains the header and object files necessary for
developing OSPF-API and frr applications.
diff --git a/ripd/rip_offset.c b/ripd/rip_offset.c
index 4034fe8424..d499229340 100644
--- a/ripd/rip_offset.c
+++ b/ripd/rip_offset.c
@@ -78,7 +78,7 @@ struct rip_offset_list *rip_offset_list_lookup(struct rip *rip,
return NULL;
}
-/* If metric is modifed return 1. */
+/* If metric is modified return 1. */
int rip_offset_list_apply_in(struct prefix_ipv4 *p, struct interface *ifp,
uint32_t *metric)
{
@@ -115,7 +115,7 @@ int rip_offset_list_apply_in(struct prefix_ipv4 *p, struct interface *ifp,
return 0;
}
-/* If metric is modifed return 1. */
+/* If metric is modified return 1. */
int rip_offset_list_apply_out(struct prefix_ipv4 *p, struct interface *ifp,
uint32_t *metric)
{
diff --git a/ripd/ripd.h b/ripd/ripd.h
index 85aac985f5..f26dcd8775 100644
--- a/ripd/ripd.h
+++ b/ripd/ripd.h
@@ -526,7 +526,7 @@ extern void rip_cli_init(void);
extern struct zebra_privs_t ripd_privs;
extern struct rip_instance_head rip_instances;
-/* Master thread strucutre. */
+/* Master thread structure. */
extern struct thread_master *master;
DECLARE_HOOK(rip_ifaddr_add, (struct connected * ifc), (ifc));
diff --git a/ripngd/ripng_offset.c b/ripngd/ripng_offset.c
index efce8a0926..38c69f1b75 100644
--- a/ripngd/ripng_offset.c
+++ b/ripngd/ripng_offset.c
@@ -85,7 +85,7 @@ struct ripng_offset_list *ripng_offset_list_lookup(struct ripng *ripng,
return NULL;
}
-/* If metric is modifed return 1. */
+/* If metric is modified return 1. */
int ripng_offset_list_apply_in(struct ripng *ripng, struct prefix_ipv6 *p,
struct interface *ifp, uint8_t *metric)
{
@@ -123,7 +123,7 @@ int ripng_offset_list_apply_in(struct ripng *ripng, struct prefix_ipv6 *p,
return 0;
}
-/* If metric is modifed return 1. */
+/* If metric is modified return 1. */
int ripng_offset_list_apply_out(struct ripng *ripng, struct prefix_ipv6 *p,
struct interface *ifp, uint8_t *metric)
{
diff --git a/tests/isisd/test_topologies.c b/tests/isisd/test_topologies.c
index ca103948f3..b3e500a33c 100644
--- a/tests/isisd/test_topologies.c
+++ b/tests/isisd/test_topologies.c
@@ -31,7 +31,7 @@
* - The Router-ID is 10.0.255.X, where X is the node number;
* - The default link metric is 10;
* - When SR is enabled, Adj-SIDs and Prefix-SIDs are generated automatically;
- * - When SR is enabled, the default SRGB is [16000-23999] (can be overriden).
+ * - When SR is enabled, the default SRGB is [16000-23999] (can be overridden).
*
* Test topology 1:
* ================
diff --git a/tests/lib/test_table.c b/tests/lib/test_table.c
index 9b6539e3bc..cef93ad0c5 100644
--- a/tests/lib/test_table.c
+++ b/tests/lib/test_table.c
@@ -382,7 +382,7 @@ static void verify_prefix_iter_cmp(const char *p1, const char *p2,
assert(exp_result == result);
/*
- * Also check the reverse comparision.
+ * Also check the reverse comparison.
*/
result = route_table_prefix_iter_cmp((struct prefix *)&p2_pfx,
(struct prefix *)&p1_pfx);
@@ -398,7 +398,7 @@ static void verify_prefix_iter_cmp(const char *p1, const char *p2,
/*
* test_prefix_iter_cmp
*
- * Tests comparision of prefixes according to order of iteration.
+ * Tests comparison of prefixes according to order of iteration.
*/
static void test_prefix_iter_cmp(void)
{
diff --git a/tests/topotests/bgp_auth/test_bgp_auth.py b/tests/topotests/bgp_auth/test_bgp_auth.py
index f01c7f206a..9e8136c17b 100644
--- a/tests/topotests/bgp_auth/test_bgp_auth.py
+++ b/tests/topotests/bgp_auth/test_bgp_auth.py
@@ -158,7 +158,7 @@ def setup_module(mod):
# This is a sample of configuration loading.
router_list = tgen.routers()
- # For all registred routers, load the zebra configuration file
+ # For all registered routers, load the zebra configuration file
for rname, router in router_list.items():
router.load_config(TopoRouter.RD_ZEBRA, "zebra.conf")
router.load_config(TopoRouter.RD_OSPF)
diff --git a/tests/topotests/bgp_basic_functionality_topo1/test_bgp_basic_functionality.py b/tests/topotests/bgp_basic_functionality_topo1/test_bgp_basic_functionality.py
index 600bf3adc0..b18e32f6bd 100644
--- a/tests/topotests/bgp_basic_functionality_topo1/test_bgp_basic_functionality.py
+++ b/tests/topotests/bgp_basic_functionality_topo1/test_bgp_basic_functionality.py
@@ -371,7 +371,7 @@ def test_bgp_timers_functionality(request):
# Creating configuration from JSON
reset_config_on_routers(tgen)
- # Api call to modfiy BGP timerse
+ # Api call to modify BGP timerse
input_dict = {
"r1": {
"bgp": {
diff --git a/tests/topotests/bgp_evpn_overlay_index_gateway/test_bgp_evpn_overlay_index_gateway.py b/tests/topotests/bgp_evpn_overlay_index_gateway/test_bgp_evpn_overlay_index_gateway.py
index c594079d4f..86a8751621 100755
--- a/tests/topotests/bgp_evpn_overlay_index_gateway/test_bgp_evpn_overlay_index_gateway.py
+++ b/tests/topotests/bgp_evpn_overlay_index_gateway/test_bgp_evpn_overlay_index_gateway.py
@@ -192,7 +192,7 @@ def setup_module(mod):
pe.cmd_raises("sysctl -w net.ipv4.udp_l3mdev_accept={}".format(l3mdev_accept))
pe.cmd_raises("sysctl -w net.ipv4.tcp_l3mdev_accept={}".format(l3mdev_accept))
- # For all registred routers, load the zebra configuration file
+ # For all registered routers, load the zebra configuration file
for (name, router) in tgen.routers().items():
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(name))
diff --git a/tests/topotests/bgp_evpn_vxlan_topo1/test_bgp_evpn_vxlan.py b/tests/topotests/bgp_evpn_vxlan_topo1/test_bgp_evpn_vxlan.py
index 40972d4a6a..5d0a326afb 100755
--- a/tests/topotests/bgp_evpn_vxlan_topo1/test_bgp_evpn_vxlan.py
+++ b/tests/topotests/bgp_evpn_vxlan_topo1/test_bgp_evpn_vxlan.py
@@ -118,7 +118,7 @@ def setup_module(mod):
# This is a sample of configuration loading.
router_list = tgen.routers()
- # For all registred routers, load the zebra configuration file
+ # For all registered routers, load the zebra configuration file
for rname, router in router_list.items():
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
diff --git a/tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-3.py b/tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-3.py
index a5c833dc5d..e60552ed10 100644
--- a/tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-3.py
+++ b/tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-3.py
@@ -1041,7 +1041,7 @@ def test_BGP_GR_15_p2(request):
logger.info(
"[Step 2] : Test Setup "
"[Helper Mode]R6-----R1[Restart Mode]"
- "--------R2[Helper Mode] Initilized"
+ "--------R2[Helper Mode] Initialized"
)
# Configure graceful-restart
diff --git a/tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-4.py b/tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-4.py
index 8671a79323..1df77ebeb2 100644
--- a/tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-4.py
+++ b/tests/topotests/bgp_gr_functionality_topo2/test_bgp_gr_functionality_topo2-4.py
@@ -456,7 +456,7 @@ def test_BGP_GR_20_p1(request):
reset_config_on_routers(tgen)
logger.info(
- "[Step 1] : Test Setup " "[Restart Mode]R3-----R1[Restart Mode] Initilized"
+ "[Step 1] : Test Setup " "[Restart Mode]R3-----R1[Restart Mode] Initialized"
)
# Configure graceful-restart
@@ -602,7 +602,7 @@ def test_BGP_GR_21_p2(request):
reset_config_on_routers(tgen)
logger.info(
- "[Step 1] : Test Setup " "[Helper Mode]R6-----R1[Restart Mode] Initilized"
+ "[Step 1] : Test Setup " "[Helper Mode]R6-----R1[Restart Mode] Initialized"
)
# Configure graceful-restart
@@ -676,7 +676,7 @@ def test_BGP_GR_21_p2(request):
logger.info(
"[Step 2] : Test Setup "
"[Restart Mode]R2-----[Helper Mode]R1[Disable Mode]"
- "--------R6[Helper Mode] Initilized"
+ "--------R6[Helper Mode] Initialized"
)
# Configure graceful-restart
@@ -821,7 +821,7 @@ def test_BGP_GR_22_p2(request):
reset_config_on_routers(tgen)
logger.info(
- "[Step 1] : Test Setup " "[Helper Mode]R3-----R1[Restart Mode] Initilized"
+ "[Step 1] : Test Setup " "[Helper Mode]R3-----R1[Restart Mode] Initialized"
)
# Configure graceful-restart
@@ -901,7 +901,7 @@ def test_BGP_GR_22_p2(request):
logger.info(
"[Step 2] : Test Setup "
"[Restart Mode]R2-----[Helper Mode]R1[Disable Mode]"
- "--------R3[Helper Mode] Initilized"
+ "--------R3[Helper Mode] Initialized"
)
# Configure graceful-restart
diff --git a/tests/topotests/bgp_lu_topo1/test_bgp_lu.py b/tests/topotests/bgp_lu_topo1/test_bgp_lu.py
index 8941854593..8955f2794d 100644
--- a/tests/topotests/bgp_lu_topo1/test_bgp_lu.py
+++ b/tests/topotests/bgp_lu_topo1/test_bgp_lu.py
@@ -92,7 +92,7 @@ def setup_module(mod):
# This is a sample of configuration loading.
router_list = tgen.routers()
- # For all registred routers, load the zebra configuration file
+ # For all registered routers, load the zebra configuration file
for rname, router in router_list.items():
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
diff --git a/tests/topotests/bgp_multi_vrf_topo2/test_bgp_multi_vrf_topo2.py b/tests/topotests/bgp_multi_vrf_topo2/test_bgp_multi_vrf_topo2.py
index 35e81d1c62..04ebe61a02 100644
--- a/tests/topotests/bgp_multi_vrf_topo2/test_bgp_multi_vrf_topo2.py
+++ b/tests/topotests/bgp_multi_vrf_topo2/test_bgp_multi_vrf_topo2.py
@@ -1224,7 +1224,7 @@ def test_shut_noshut_p1(request):
result = create_router_bgp(tgen, topo, input_dict_3)
assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
- step("Api call to modfiy BGP timers")
+ step("Api call to modify BGP timers")
input_dict_4 = {
"r1": {
@@ -1757,7 +1757,7 @@ def test_vrf_vlan_routing_table_p1(request):
tc_name, result
)
- step("Api call to modfiy BGP timers")
+ step("Api call to modify BGP timers")
input_dict_4 = {
"r3": {
@@ -2422,7 +2422,7 @@ def test_delete_and_re_add_vrf_p1(request):
result = verify_rib(tgen, addr_type, dut, input_dict_2)
assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result)
- step("Api call to modfiy BGP timers")
+ step("Api call to modify BGP timers")
input_dict_4 = {
"r1": {
@@ -3034,7 +3034,7 @@ def test_vrf_name_significance_p1(request):
result = verify_rib(tgen, addr_type, dut, input_dict_4)
assert result is True, "Testcase {} :Failed \n Error {}".format(tc_name, result)
- step("Api call to modfiy BGP timers")
+ step("Api call to modify BGP timers")
input_dict_4 = {
"r3": {
@@ -3437,7 +3437,7 @@ def test_vrf_name_significance_p1(request):
result = create_router_bgp(tgen, topo_modify["routers"])
assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result)
- step("Api call to modfiy BGP timers")
+ step("Api call to modify BGP timers")
input_dict_4 = {
"r3": {
diff --git a/tests/topotests/bgp_snmp_mplsl3vpn/test_bgp_snmp_mplsvpn.py b/tests/topotests/bgp_snmp_mplsl3vpn/test_bgp_snmp_mplsvpn.py
index 0d27474cbd..d612ad2c94 100755
--- a/tests/topotests/bgp_snmp_mplsl3vpn/test_bgp_snmp_mplsvpn.py
+++ b/tests/topotests/bgp_snmp_mplsl3vpn/test_bgp_snmp_mplsvpn.py
@@ -154,7 +154,7 @@ def setup_module(mod):
router_list = tgen.routers()
- # For all registred routers, load the zebra configuration file
+ # For all registered routers, load the zebra configuration file
for rname, router in router_list.items():
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
diff --git a/tests/topotests/grpc_basic/test_basic_grpc.py b/tests/topotests/grpc_basic/test_basic_grpc.py
index b6812a5afc..6bd0be9fd9 100644
--- a/tests/topotests/grpc_basic/test_basic_grpc.py
+++ b/tests/topotests/grpc_basic/test_basic_grpc.py
@@ -122,7 +122,7 @@ def test_get_config(tgen):
nrepeat = 5
r1 = tgen.gears["r1"]
- step("'GET' inteface config 10 times, once per invocation")
+ step("'GET' interface config 10 times, once per invocation")
for i in range(0, nrepeat):
output = run_grpc_client(r1, GRPCP_ZEBRA, "GET,/frr-interface:lib")
diff --git a/tests/topotests/lib/ltemplate.py b/tests/topotests/lib/ltemplate.py
index 18882285ed..2544023c43 100644
--- a/tests/topotests/lib/ltemplate.py
+++ b/tests/topotests/lib/ltemplate.py
@@ -93,7 +93,7 @@ class LTemplate:
# This is a sample of configuration loading.
router_list = tgen.routers()
- # For all registred routers, load the zebra configuration file
+ # For all registered routers, load the zebra configuration file
for rname, router in router_list.items():
logger.info("Setting up %s" % rname)
for rd_val in TopoRouter.RD:
diff --git a/tests/topotests/lib/topogen.py b/tests/topotests/lib/topogen.py
index 4ed5b2f825..c04506f47e 100644
--- a/tests/topotests/lib/topogen.py
+++ b/tests/topotests/lib/topogen.py
@@ -443,7 +443,7 @@ class Topogen(object):
def start_router(self, router=None):
"""
Call the router startRouter method.
- If no router is specified it is called for all registred routers.
+ If no router is specified it is called for all registered routers.
"""
if router is None:
# pylint: disable=r1704
diff --git a/tests/topotests/lib/topotest.py b/tests/topotests/lib/topotest.py
index e786ae02cd..27b566a8f5 100644
--- a/tests/topotests/lib/topotest.py
+++ b/tests/topotests/lib/topotest.py
@@ -746,7 +746,7 @@ def proto_name_to_number(protocol):
def ip4_route(node):
"""
Gets a structured return of the command 'ip route'. It can be used in
- conjuction with json_cmp() to provide accurate assert explanations.
+ conjunction with json_cmp() to provide accurate assert explanations.
Return example:
{
@@ -787,7 +787,7 @@ def ip4_route(node):
def ip4_vrf_route(node):
"""
Gets a structured return of the command 'ip route show vrf {0}-cust1'.
- It can be used in conjuction with json_cmp() to provide accurate assert explanations.
+ It can be used in conjunction with json_cmp() to provide accurate assert explanations.
Return example:
{
@@ -831,7 +831,7 @@ def ip4_vrf_route(node):
def ip6_route(node):
"""
Gets a structured return of the command 'ip -6 route'. It can be used in
- conjuction with json_cmp() to provide accurate assert explanations.
+ conjunction with json_cmp() to provide accurate assert explanations.
Return example:
{
@@ -871,7 +871,7 @@ def ip6_route(node):
def ip6_vrf_route(node):
"""
Gets a structured return of the command 'ip -6 route show vrf {0}-cust1'.
- It can be used in conjuction with json_cmp() to provide accurate assert explanations.
+ It can be used in conjunction with json_cmp() to provide accurate assert explanations.
Return example:
{
@@ -913,7 +913,7 @@ def ip6_vrf_route(node):
def ip_rules(node):
"""
Gets a structured return of the command 'ip rule'. It can be used in
- conjuction with json_cmp() to provide accurate assert explanations.
+ conjunction with json_cmp() to provide accurate assert explanations.
Return example:
[
diff --git a/tests/topotests/multicast_pim_bsm_topo1/test_mcast_pim_bsmp_01.py b/tests/topotests/multicast_pim_bsm_topo1/test_mcast_pim_bsmp_01.py
index 1a55d6d9f1..1762535cee 100644
--- a/tests/topotests/multicast_pim_bsm_topo1/test_mcast_pim_bsmp_01.py
+++ b/tests/topotests/multicast_pim_bsm_topo1/test_mcast_pim_bsmp_01.py
@@ -34,7 +34,7 @@ Tests covered in this suite
3.2 Verify if no forwarding bit is set , FRR is not forwarding the
BSM to other PIM nbrs
3.3 Verify multicast BSM is sent to new router when unicast BSM is disabled
-4.1 Verfiy BSM arrived on non bsm capable interface is dropped and
+4.1 Verify BSM arrived on non bsm capable interface is dropped and
not processed
4.2 Verify group to RP info updated correctly in FRR node, after shut and
no-shut of BSM enable interfaces
@@ -865,7 +865,7 @@ def test_new_router_fwd_p0(request):
def test_int_bsm_config_p1(request):
"""
- 1. Verfiy BSM arrived on non bsm capable interface is dropped and
+ 1. Verify BSM arrived on non bsm capable interface is dropped and
not processed
2. Verify group to RP info updated correctly in FRR node, after shut and
no-shut of BSM enable interfaces
diff --git a/tests/topotests/multicast_pim_static_rp_topo1/test_multicast_pim_static_rp.py b/tests/topotests/multicast_pim_static_rp_topo1/test_multicast_pim_static_rp.py
index 210f960b60..b9a7cc7cd7 100755
--- a/tests/topotests/multicast_pim_static_rp_topo1/test_multicast_pim_static_rp.py
+++ b/tests/topotests/multicast_pim_static_rp_topo1/test_multicast_pim_static_rp.py
@@ -69,7 +69,7 @@ TC_18 : Verify RPF interface updated in mroute when higher preferred RP gets
deleted
TC_19 : Verify IIF and OIL in "show ip pim state" updated when higher
preferred overlapping RP is deleted
-TC_20 : Verfiy PIM upstream IIF updated when higher preferred overlapping RP
+TC_20 : Verify PIM upstream IIF updated when higher preferred overlapping RP
deleted
TC_21_1 : Verify OIF and RFP for (*,G) and (S,G) when static RP configure in
LHR router
@@ -94,7 +94,7 @@ TC_30 : Verify IIF and OIL change to other path after shut the primary path
TC_31 : Verify RP info and (*,G) mroute after deleting the RP and shut / no
shut the RPF interface.
TC_32 : Verify RP info and (*,G) mroute after deleting the RP and shut / no
- shut the RPF inteface
+ shut the RPF interface
"""
import os
@@ -1157,7 +1157,7 @@ def test_send_join_on_higher_preffered_rp_p1(request):
gets deleted
TC_19_P1 : Verify IIF and OIL in "show ip pim state" updated when higher
preferred overlapping RP is deleted
- TC_20_P1 : Verfiy PIM upstream IIF updated when higher preferred
+ TC_20_P1 : Verify PIM upstream IIF updated when higher preferred
overlapping RP deleted
Topology used:
@@ -1354,7 +1354,7 @@ def test_send_join_on_higher_preffered_rp_p1(request):
assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result)
step(
- "r1 : Verfiy upstream IIF updated when higher preferred overlapping"
+ "r1 : Verify upstream IIF updated when higher preferred overlapping"
"RP deleted"
)
result = verify_upstream_iif(tgen, dut, iif, STAR, GROUP_ADDRESS)
@@ -3820,7 +3820,7 @@ def test_delete_RP_shut_noshut_upstream_interface_p1(request):
def test_delete_RP_shut_noshut_RP_interface_p1(request):
"""
TC_32_P1: Verify RP info and (*,G) mroute after deleting the RP and shut/
- no shut the RPF inteface
+ no shut the RPF interface
Topology used:
________r2_____
diff --git a/tests/topotests/ospf_suppress_fa/test_ospf_suppress_fa.py b/tests/topotests/ospf_suppress_fa/test_ospf_suppress_fa.py
index 01ddbc1521..5903649d67 100644
--- a/tests/topotests/ospf_suppress_fa/test_ospf_suppress_fa.py
+++ b/tests/topotests/ospf_suppress_fa/test_ospf_suppress_fa.py
@@ -79,7 +79,7 @@ def setup_module(mod):
# This is a sample of configuration loading.
router_list = tgen.routers()
- # For all registred routers, load the zebra and ospf configuration file
+ # For all registered routers, load the zebra and ospf configuration file
for rname, router in router_list.items():
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
diff --git a/tests/topotests/simple_snmp_test/test_simple_snmp.py b/tests/topotests/simple_snmp_test/test_simple_snmp.py
index 35f0210134..1ca06c6571 100755
--- a/tests/topotests/simple_snmp_test/test_simple_snmp.py
+++ b/tests/topotests/simple_snmp_test/test_simple_snmp.py
@@ -69,7 +69,7 @@ def setup_module(mod):
router_list = tgen.routers()
- # For all registred routers, load the zebra configuration file
+ # For all registered routers, load the zebra configuration file
for rname, router in router_list.items():
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
diff --git a/tests/topotests/static_routing_with_ibgp/test_static_routes_topo4_ibgp.py b/tests/topotests/static_routing_with_ibgp/test_static_routes_topo4_ibgp.py
index 8c97d6cb7e..d5e5148eae 100644
--- a/tests/topotests/static_routing_with_ibgp/test_static_routes_topo4_ibgp.py
+++ b/tests/topotests/static_routing_with_ibgp/test_static_routes_topo4_ibgp.py
@@ -175,7 +175,7 @@ def test_static_routes_rmap_pfxlist_p0_tc7_ibgp(request):
)
for addr_type in ADDR_TYPES:
- # Api call to modfiy BGP timerse
+ # Api call to modify BGP timerse
input_dict = {
"r2": {
"bgp": {
diff --git a/tests/topotests/zebra_multiple_connected/r1/ip_route2.json b/tests/topotests/zebra_multiple_connected/r1/ip_route2.json
new file mode 100644
index 0000000000..26995654f7
--- /dev/null
+++ b/tests/topotests/zebra_multiple_connected/r1/ip_route2.json
@@ -0,0 +1,102 @@
+{
+ "10.0.1.0/24":[
+ {
+ "prefix":"10.0.1.0/24",
+ "prefixLen":24,
+ "protocol":"connected",
+ "vrfName":"default",
+ "distance":0,
+ "metric":0,
+ "installed":true,
+ "table":254,
+ "nexthops":[
+ {
+ "fib":true,
+ "directlyConnected":true,
+ "interfaceName":"r1-eth1",
+ "active":true
+ }
+ ]
+ },
+ {
+ "prefix":"10.0.1.0/24",
+ "prefixLen":24,
+ "protocol":"connected",
+ "vrfName":"default",
+ "distance":0,
+ "metric":0,
+ "installed":true,
+ "table":254,
+ "nexthops":[
+ {
+ "fib":true,
+ "directlyConnected":true,
+ "interfaceName":"r1-eth0",
+ "active":true
+ }
+ ]
+ }
+ ],
+ "10.0.1.30/32":[
+ {
+ "prefix":"10.0.1.30/32",
+ "prefixLen":32,
+ "protocol":"kernel",
+ "vrfName":"default",
+ "distance":0,
+ "metric":0,
+ "installed":true,
+ "table":254,
+ "nexthops":[
+ {
+ "fib":true,
+ "directlyConnected":true,
+ "interfaceName":"r1-eth1",
+ "active":true
+ }
+ ]
+ }
+ ],
+ "10.9.9.0/24":[
+ {
+ "prefix":"10.9.9.0/24",
+ "prefixLen":24,
+ "protocol":"kernel",
+ "vrfName":"default",
+ "distance":0,
+ "metric":0,
+ "installed":true,
+ "table":254,
+ "nexthops":[
+ {
+ "fib":true,
+ "ip":"10.0.1.30",
+ "afi":"ipv4",
+ "interfaceName":"r1-eth1",
+ "active":true
+ }
+ ]
+ }
+ ],
+ "192.168.1.1/32":[
+ {
+ "prefix":"192.168.1.1/32",
+ "prefixLen":32,
+ "protocol":"kernel",
+ "vrfName":"default",
+ "distance":0,
+ "metric":0,
+ "installed":true,
+ "table":254,
+ "nexthops":[
+ {
+ "fib":true,
+ "ip":"10.0.1.99",
+ "afi":"ipv4",
+ "interfaceName":"r1-eth1",
+ "active":true
+ }
+ ]
+ }
+ ]
+}
diff --git a/tests/topotests/zebra_multiple_connected/test_zebra_multiple_connected.py b/tests/topotests/zebra_multiple_connected/test_zebra_multiple_connected.py
index 31ac831b35..8882cf5bda 100644
--- a/tests/topotests/zebra_multiple_connected/test_zebra_multiple_connected.py
+++ b/tests/topotests/zebra_multiple_connected/test_zebra_multiple_connected.py
@@ -133,6 +133,30 @@ def test_zebra_connected_multiple():
assert result is None, "Kernel route is missing from zebra"
+def test_zebra_system_recursion():
+ "Test a system route recursing through another system route"
+
+ tgen = get_topogen()
+ if tgen.routers_have_failure():
+ pytest.skip(tgen.errors)
+
+ router = tgen.gears["r1"]
+ router.run("ip route add 10.0.1.30/32 dev r1-eth1")
+ router.run("ip route add 10.9.9.0/24 via 10.0.1.30 dev r1-eth1")
+ router.run("ip link add dummy2 type dummy")
+ router.run("ip link set dummy2 up")
+ router.run("ip link set dummy2 down")
+
+ routes = "{}/{}/ip_route2.json".format(CWD, router.name)
+ expected = json.loads(open(routes).read())
+ test_func = partial(
+ topotest.router_json_cmp, router, "show ip route json", expected
+ )
+
+ _, result = topotest.run_and_expect(test_func, None, count=20, wait=1)
+ assert result is None, "Kernel route is missing from zebra"
+
+
if __name__ == "__main__":
args = ["-s"] + sys.argv[1:]
sys.exit(pytest.main(args))
diff --git a/tools/etc/rsyslog.d/45-frr.conf b/tools/etc/rsyslog.d/45-frr.conf
index feeeb13f13..469e95ed73 100644
--- a/tools/etc/rsyslog.d/45-frr.conf
+++ b/tools/etc/rsyslog.d/45-frr.conf
@@ -14,6 +14,7 @@ if $programname == 'babeld' or
$programname == 'ospf6d' or
$programname == 'ospfd' or
$programname == 'pimd' or
+ $programname == 'pathd' or
$programname == 'ripd' or
$programname == 'ripngd' or
$programname == 'vrrpd' or
@@ -32,6 +33,7 @@ if $programname == 'babeld' or
$programname == 'ospf6d' or
$programname == 'ospfd' or
$programname == 'pimd' or
+ $programname == 'pathd' or
$programname == 'ripd' or
$programname == 'ripngd' or
$programname == 'vrrpd' or
diff --git a/tools/frrinit.sh.in b/tools/frrinit.sh.in
index df5f0853da..bc93ea33f0 100644
--- a/tools/frrinit.sh.in
+++ b/tools/frrinit.sh.in
@@ -127,6 +127,8 @@ reload)
;;
*)
- log_failure_msg "Unknown command: $1" >&2
+ echo "Usage:"
+ echo " ${0} (start|stop|restart|force-reload|reload|status)"
exit 1
+ ;;
esac
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 0b85b2ea49..74886254bd 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -3361,6 +3361,18 @@ int vtysh_write_config_integrated(void)
err++;
}
+ if (fflush(fp) != 0) {
+ printf("%% Warning: fflush() failed on %s: %s\n", frr_config,
+ safe_strerror(errno));
+ err++;
+ }
+
+ if (fsync(fd) < 0) {
+ printf("%% Warning: fsync() failed on %s: %s\n", frr_config,
+ safe_strerror(errno));
+ err++;
+ }
+
fclose(fp);
printf("Integrated configuration saved to %s\n", frr_config);
diff --git a/watchfrr/watchfrr.c b/watchfrr/watchfrr.c
index 3a5919edeb..51e4f802c9 100644
--- a/watchfrr/watchfrr.c
+++ b/watchfrr/watchfrr.c
@@ -54,6 +54,7 @@
#define DEFAULT_LOGLEVEL LOG_INFO
#define DEFAULT_MIN_RESTART 60
#define DEFAULT_MAX_RESTART 600
+#define DEFAULT_OPERATIONAL_TIMEOUT 60
#define DEFAULT_RESTART_CMD WATCHFRR_SH_PATH " restart %s"
#define DEFAULT_START_CMD WATCHFRR_SH_PATH " start %s"
@@ -106,12 +107,14 @@ static struct global_state {
enum restart_phase phase;
struct thread *t_phase_hanging;
struct thread *t_startup_timeout;
+ struct thread *t_operational;
const char *vtydir;
long period;
long timeout;
long restart_timeout;
long min_restart_interval;
long max_restart_interval;
+ long operational_timeout;
struct daemon *daemons;
const char *restart_command;
const char *start_command;
@@ -131,6 +134,7 @@ static struct global_state {
.loglevel = DEFAULT_LOGLEVEL,
.min_restart_interval = DEFAULT_MIN_RESTART,
.max_restart_interval = DEFAULT_MAX_RESTART,
+ .operational_timeout = DEFAULT_OPERATIONAL_TIMEOUT,
.restart_command = DEFAULT_RESTART_CMD,
.start_command = DEFAULT_START_CMD,
.stop_command = DEFAULT_STOP_CMD,
@@ -177,6 +181,7 @@ struct daemon {
#define OPTION_MAXRESTART 2001
#define OPTION_DRY 2002
#define OPTION_NETNS 2003
+#define OPTION_MAXOPERATIONAL 2004
static const struct option longopts[] = {
{"daemon", no_argument, NULL, 'd'},
@@ -191,6 +196,7 @@ static const struct option longopts[] = {
{"dry", no_argument, NULL, OPTION_DRY},
{"min-restart-interval", required_argument, NULL, OPTION_MINRESTART},
{"max-restart-interval", required_argument, NULL, OPTION_MAXRESTART},
+ {"operational-timeout", required_argument, NULL, OPTION_MAXOPERATIONAL},
{"pid-file", required_argument, NULL, 'p'},
{"blank-string", required_argument, NULL, 'b'},
#ifdef GNU_LINUX
@@ -265,6 +271,9 @@ Otherwise, the interval is doubled (but capped at the -M value).\n\n",
--max-restart-interval\n\
Set the maximum seconds to wait between invocations of daemon\n\
restart commands (default is %d).\n\
+ --operational-timeout\n\
+ Set the time before systemd is notified that we are considered\n\
+ operational again after a daemon restart (default is %d).\n\
-i, --interval Set the status polling interval in seconds (default is %d)\n\
-t, --timeout Set the unresponsiveness timeout in seconds (default is %d)\n\
-T, --restart-timeout\n\
@@ -296,10 +305,10 @@ Otherwise, the interval is doubled (but capped at the -M value).\n\n",
-v, --version Print program version\n\
-h, --help Display this help and exit\n",
frr_vtydir, DEFAULT_LOGLEVEL, LOG_EMERG, LOG_DEBUG, LOG_DEBUG,
- DEFAULT_MIN_RESTART, DEFAULT_MAX_RESTART, DEFAULT_PERIOD,
- DEFAULT_TIMEOUT, DEFAULT_RESTART_TIMEOUT,
- DEFAULT_RESTART_CMD, DEFAULT_START_CMD, DEFAULT_STOP_CMD,
- frr_vtydir);
+ DEFAULT_MIN_RESTART, DEFAULT_MAX_RESTART,
+ DEFAULT_OPERATIONAL_TIMEOUT, DEFAULT_PERIOD, DEFAULT_TIMEOUT,
+ DEFAULT_RESTART_TIMEOUT, DEFAULT_RESTART_CMD, DEFAULT_START_CMD,
+ DEFAULT_STOP_CMD, frr_vtydir);
}
static pid_t run_background(char *shell_cmd)
@@ -502,8 +511,6 @@ static int run_job(struct restart_info *restart, const char *cmdtype,
restart->pid = 0;
}
- systemd_send_status("FRR Operational");
-
/* Calculate the new restart interval. */
if (update_interval) {
if (delay.tv_sec > 2 * gs.max_restart_interval)
@@ -584,6 +591,11 @@ static void restart_done(struct daemon *dmn)
SET_WAKEUP_DOWN(dmn);
}
+static void daemon_restarting_operational(struct thread *thread)
+{
+ systemd_send_status("FRR Operational");
+}
+
static void daemon_down(struct daemon *dmn, const char *why)
{
if (IS_UP(dmn) || (dmn->state == DAEMON_INIT))
@@ -603,6 +615,8 @@ static void daemon_down(struct daemon *dmn, const char *why)
THREAD_OFF(dmn->t_wakeup);
if (try_connect(dmn) < 0)
SET_WAKEUP_DOWN(dmn);
+
+ systemd_send_status("FRR partially operational");
phase_check();
}
@@ -721,8 +735,15 @@ static void daemon_up(struct daemon *dmn, const char *why)
gs.numdown--;
dmn->connect_tries = 0;
zlog_notice("%s state -> up : %s", dmn->name, why);
- if (gs.numdown == 0)
+ if (gs.numdown == 0) {
daemon_send_ready(0);
+
+ THREAD_OFF(gs.t_operational);
+
+ thread_add_timer(master, daemon_restarting_operational, NULL,
+ gs.operational_timeout, &gs.t_operational);
+ }
+
SET_WAKEUP_ECHO(dmn);
phase_check();
}
@@ -889,6 +910,7 @@ static void phase_check(void)
case PHASE_WAITING_DOWN:
if (gs.numdown + IS_UP(gs.special) < gs.numdaemons)
break;
+ systemd_send_status("Phased Restart");
zlog_info("Phased restart: all routing daemons now down.");
run_job(&gs.special->restart, "restart", gs.restart_command, 1,
1);
@@ -898,6 +920,7 @@ static void phase_check(void)
case PHASE_ZEBRA_RESTART_PENDING:
if (gs.special->restart.pid)
break;
+ systemd_send_status("Zebra Restarting");
zlog_info("Phased restart: %s restart job completed.",
gs.special->name);
set_phase(PHASE_WAITING_ZEBRA_UP);
@@ -1030,6 +1053,12 @@ void watchfrr_status(struct vty *vty)
struct timeval delay;
vty_out(vty, "watchfrr global phase: %s\n", phase_str[gs.phase]);
+ vty_out(vty, " Restart Command: %pSQq\n", gs.restart_command);
+ vty_out(vty, " Start Command: %pSQq\n", gs.start_command);
+ vty_out(vty, " Stop Command: %pSQq\n", gs.stop_command);
+ vty_out(vty, " Min Restart Interval: %ld\n", gs.min_restart_interval);
+ vty_out(vty, " Max Restart Interval: %ld\n", gs.max_restart_interval);
+ vty_out(vty, " Restart Timeout: %ld\n", gs.restart_timeout);
if (gs.restart.pid)
vty_out(vty, " global restart running, pid %ld\n",
(long)gs.restart.pid);
@@ -1395,6 +1424,18 @@ int main(int argc, char **argv)
frr_help_exit(1);
}
} break;
+ case OPTION_MAXOPERATIONAL: {
+ char garbage[3];
+
+ if ((sscanf(optarg, "%ld%1s", &gs.operational_timeout,
+ garbage) != 1) ||
+ (gs.max_restart_interval < 0)) {
+ fprintf(stderr,
+ "Invalid Operational_timeout argument: %s\n",
+ optarg);
+ frr_help_exit(1);
+ }
+ } break;
case OPTION_NETNS:
netns_en = true;
if (optarg && strchr(optarg, '/')) {
diff --git a/zebra/connected.c b/zebra/connected.c
index 4f4e8be34b..eb2720335e 100644
--- a/zebra/connected.c
+++ b/zebra/connected.c
@@ -327,6 +327,8 @@ void connected_add_ipv4(struct interface *ifp, int flags,
/* If we get a notification from the kernel,
* we can safely assume the address is known to the kernel */
SET_FLAG(ifc->conf, ZEBRA_IFC_QUEUED);
+ if (!if_is_operative(ifp))
+ SET_FLAG(ifc->conf, ZEBRA_IFC_DOWN);
/* Allocate new connected address. */
p = prefix_ipv4_new();
@@ -548,6 +550,8 @@ void connected_add_ipv6(struct interface *ifp, int flags,
/* If we get a notification from the kernel,
* we can safely assume the address is known to the kernel */
SET_FLAG(ifc->conf, ZEBRA_IFC_QUEUED);
+ if (!if_is_operative(ifp))
+ SET_FLAG(ifc->conf, ZEBRA_IFC_DOWN);
/* Allocate new connected address. */
p = prefix_ipv6_new();
diff --git a/zebra/interface.c b/zebra/interface.c
index a70326ebb3..677ec4650f 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -958,7 +958,7 @@ void if_nbr_mac_to_ipv4ll_neigh_update(struct interface *ifp,
/*
* We need to note whether or not we originated a v6
* neighbor entry for this interface. So that when
- * someone unwisely accidently deletes this entry
+ * someone unwisely accidentally deletes this entry
* we can shove it back in.
*/
zif->v6_2_v4_ll_neigh_entry = !!add;
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 2ff083dec5..f91b2f8897 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -3802,7 +3802,7 @@ static int netlink_ipneigh_change(struct nlmsghdr *h, int len, ns_id_t ns_id)
* interface
* and is linked to the bridge
* (b) In the case of a VLAN-unaware bridge, the SVI is the bridge
- * inteface
+ * interface
* itself
*/
if (IS_ZEBRA_IF_VLAN(ifp)) {
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c
index d034c8f306..4e753c9d1a 100644
--- a/zebra/zebra_dplane.c
+++ b/zebra/zebra_dplane.c
@@ -2679,7 +2679,7 @@ done:
}
/**
- * dplane_ctx_intf_init() - Initialize a context block for a inteface update
+ * dplane_ctx_intf_init() - Initialize a context block for a interface update
*
* @ctx: Dataplane context to init
* @op: Operation being performed
diff --git a/zebra/zebra_evpn_mh.c b/zebra/zebra_evpn_mh.c
index 02eda4a438..b1e48374c4 100644
--- a/zebra/zebra_evpn_mh.c
+++ b/zebra/zebra_evpn_mh.c
@@ -3286,7 +3286,7 @@ DEFPY_HIDDEN(zebra_evpn_es_bypass, zebra_evpn_es_bypass_cmd,
} else {
if (!zebra_evpn_is_if_es_capable(zif)) {
vty_out(vty,
- "%%DF bypass cannot be associated with this interface type\n");
+ "%% DF bypass cannot be associated with this interface type\n");
return CMD_WARNING;
}
zebra_evpn_es_bypass_cfg_update(zif, true);
@@ -3311,7 +3311,7 @@ DEFPY(zebra_evpn_es_pref, zebra_evpn_es_pref_cmd,
} else {
if (!zebra_evpn_is_if_es_capable(zif)) {
vty_out(vty,
- "%%DF preference cannot be associated with this interface type\n");
+ "%% DF preference cannot be associated with this interface type\n");
return CMD_WARNING;
}
zebra_evpn_es_df_pref_update(zif, df_pref);
@@ -3341,25 +3341,26 @@ DEFPY(zebra_evpn_es_sys_mac,
ret = zebra_evpn_es_sys_mac_update(zif, &zero_mac);
if (ret == -1) {
- vty_out(vty, "%%Failed to clear ES sysmac\n");
+ vty_out(vty, "%% Failed to clear ES sysmac\n");
return CMD_WARNING;
}
} else {
if (!zebra_evpn_is_if_es_capable(zif)) {
vty_out(vty,
- "%%ESI cannot be associated with this interface type\n");
+ "%% ESI cannot be associated with this interface type\n");
return CMD_WARNING;
}
if (!mac || is_zero_mac(&mac->eth_addr)) {
- vty_out(vty, "%%ES sysmac value is invalid\n");
+ vty_out(vty, "%% ES sysmac value is invalid\n");
return CMD_WARNING;
}
ret = zebra_evpn_es_sys_mac_update(zif, &mac->eth_addr);
if (ret == -1) {
- vty_out(vty, "%%ESI already exists on a different interface\n");
+ vty_out(vty,
+ "%% ESI already exists on a different interface\n");
return CMD_WARNING;
}
}
@@ -3392,25 +3393,27 @@ DEFPY(zebra_evpn_es_id,
ret = zebra_evpn_es_type0_esi_update(zif, zero_esi);
if (ret == -1) {
- vty_out(vty, "%%Failed to clear ES local id\n");
+ vty_out(vty,
+ "%% Failed to clear ES local id or ESI name\n");
return CMD_WARNING;
}
} else {
if (!zebra_evpn_is_if_es_capable(zif)) {
vty_out(vty,
- "%%ESI cannot be associated with this interface type\n");
+ "%% ESI cannot be associated with this interface type\n");
return CMD_WARNING;
}
if (esi_str) {
if (!str_to_esi(esi_str, &esi)) {
- vty_out(vty, "%% Malformed ESI\n");
+ vty_out(vty, "%% Malformed ESI name\n");
return CMD_WARNING;
}
ret = zebra_evpn_es_type0_esi_update(zif, &esi);
} else {
if (!es_lid) {
- vty_out(vty, "%%Specify local ES ID\n");
+ vty_out(vty,
+ "%% Specify ES local id or ESI name\n");
return CMD_WARNING;
}
ret = zebra_evpn_es_lid_update(zif, es_lid);
@@ -3418,7 +3421,7 @@ DEFPY(zebra_evpn_es_id,
if (ret == -1) {
vty_out(vty,
- "%%ESI already exists on a different interface\n");
+ "%% ESI already exists on a different interface\n");
return CMD_WARNING;
}
}
@@ -3758,18 +3761,10 @@ static inline bool zebra_evpn_mh_is_all_uplinks_down(void)
static void zebra_evpn_mh_uplink_oper_flags_update(struct zebra_if *zif,
bool set)
{
- if (set) {
- if (if_is_operative(zif->ifp)) {
- if (!(zif->flags & ZIF_FLAG_EVPN_MH_UPLINK_OPER_UP)) {
- zif->flags |= ZIF_FLAG_EVPN_MH_UPLINK_OPER_UP;
- ++zmh_info->uplink_oper_up_cnt;
- }
- } else {
- if (zif->flags & ZIF_FLAG_EVPN_MH_UPLINK_OPER_UP) {
- zif->flags &= ~ZIF_FLAG_EVPN_MH_UPLINK_OPER_UP;
- if (zmh_info->uplink_oper_up_cnt)
- --zmh_info->uplink_oper_up_cnt;
- }
+ if (set && if_is_operative(zif->ifp)) {
+ if (!(zif->flags & ZIF_FLAG_EVPN_MH_UPLINK_OPER_UP)) {
+ zif->flags |= ZIF_FLAG_EVPN_MH_UPLINK_OPER_UP;
+ ++zmh_info->uplink_oper_up_cnt;
}
} else {
if (zif->flags & ZIF_FLAG_EVPN_MH_UPLINK_OPER_UP) {
diff --git a/zebra/zebra_evpn_mh.h b/zebra/zebra_evpn_mh.h
index ce7b920de1..7e288853bb 100644
--- a/zebra/zebra_evpn_mh.h
+++ b/zebra/zebra_evpn_mh.h
@@ -369,17 +369,6 @@ extern void zebra_evpn_mh_json(json_object *json);
extern bool zebra_evpn_nhg_is_local_es(uint32_t nhg_id,
struct zebra_evpn_es **local_es);
extern int zebra_evpn_mh_redirect_off(struct vty *vty, bool redirect_off);
-extern int zebra_evpn_mh_startup_delay_update(struct vty *vty,
- uint32_t duration,
- bool set_default);
-extern void zebra_evpn_mh_uplink_oper_update(struct zebra_if *zif);
-extern void zebra_evpn_mh_update_protodown_bond_mbr(struct zebra_if *zif,
- bool clear,
- const char *caller);
-extern bool zebra_evpn_is_es_bond(struct interface *ifp);
-extern bool zebra_evpn_is_es_bond_member(struct interface *ifp);
-extern void zebra_evpn_mh_print(struct vty *vty);
-extern void zebra_evpn_mh_json(json_object *json);
extern void zebra_evpn_l2_nh_show(struct vty *vty, bool uj);
extern void zebra_evpn_acc_bd_svi_set(struct zebra_if *vlan_zif,
struct zebra_if *br_zif, bool is_up);
diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c
index ec22c5dd48..d4aced47f9 100644
--- a/zebra/zebra_fpm_netlink.c
+++ b/zebra/zebra_fpm_netlink.c
@@ -398,7 +398,7 @@ static int netlink_route_info_encode(struct netlink_route_info *ri,
req->r.rtm_family = ri->af;
/*
- * rtm_table field is a uchar field which can accomodate table_id less
+ * rtm_table field is a uchar field which can accommodate table_id less
* than 256.
* To support table id greater than 255, if the table_id is greater than
* 255, set rtm_table to RT_TABLE_UNSPEC and add RTA_TABLE attribute
diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c
index 02894632ea..069d35c6a3 100644
--- a/zebra/zebra_nhg.c
+++ b/zebra/zebra_nhg.c
@@ -2265,7 +2265,8 @@ static int nexthop_active(struct nexthop *nexthop, struct nhg_hash_entry *nhe,
continue;
}
- if (match->type == ZEBRA_ROUTE_CONNECT) {
+ if ((match->type == ZEBRA_ROUTE_CONNECT) ||
+ (RIB_SYSTEM_ROUTE(match) && RSYSTEM_ROUTE(type))) {
match = zebra_nhg_connected_ifindex(rn, match,
nexthop->ifindex);
@@ -3001,10 +3002,12 @@ void zebra_nhg_dplane_result(struct zebra_dplane_ctx *ctx)
nhe->zapi_session, nhe->id,
ZAPI_NHG_FAIL_INSTALL);
- flog_err(
- EC_ZEBRA_DP_INSTALL_FAIL,
- "Failed to install Nexthop ID (%u) into the kernel",
- nhe->id);
+ if (!(zebra_nhg_proto_nexthops_only() &&
+ !PROTO_OWNED(nhe)))
+ flog_err(
+ EC_ZEBRA_DP_INSTALL_FAIL,
+ "Failed to install Nexthop ID (%u) into the kernel",
+ nhe->id);
}
break;