summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/commitlint.yml5
-rw-r--r--babeld/message.c6
-rw-r--r--bgpd/bgp_label.c15
-rw-r--r--bgpd/rfapi/rfapi_import.c53
-rw-r--r--doc/developer/cli.rst46
-rw-r--r--doc/developer/workflow.rst2
-rw-r--r--doc/user/bgp.rst2
-rw-r--r--ospf6d/ospf6_abr.c9
-rw-r--r--ospf6d/ospf6_asbr.c20
-rw-r--r--ospf6d/ospf6_asbr.h2
-rw-r--r--ospf6d/ospf6_route.c3
-rw-r--r--ospf6d/ospf6_route.h2
-rw-r--r--ospf6d/ospf6_zebra.c6
-rwxr-xr-xtests/topotests/conftest.py7
14 files changed, 99 insertions, 79 deletions
diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml
index ea5b704188..06bf3b3b95 100644
--- a/.github/workflows/commitlint.yml
+++ b/.github/workflows/commitlint.yml
@@ -10,8 +10,9 @@ on:
- unlabeled
jobs:
- lint:
- if: github.repository == 'frrouting/frr'
+ commitlint:
+ if: github.repository == 'frrouting/frr' && github.base_ref == 'refs/heads/master'
+ name: Check if the commits meet the requirements of the guidelines
permissions:
contents: read
pull-requests: read
diff --git a/babeld/message.c b/babeld/message.c
index 687f768446..b5c2a58984 100644
--- a/babeld/message.c
+++ b/babeld/message.c
@@ -422,7 +422,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
debugf(BABEL_DEBUG_COMMON,
"Received Hello from %s on %s that does not have all 0's in the unused section of flags, ignoring",
format_address(from), ifp->name);
- continue;
+ goto done;
}
/*
@@ -434,7 +434,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
debugf(BABEL_DEBUG_COMMON,
"Received Unicast Hello from %s on %s that FRR is not prepared to understand yet",
format_address(from), ifp->name);
- continue;
+ goto done;
}
DO_NTOHS(seqno, message + 4);
@@ -452,7 +452,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
debugf(BABEL_DEBUG_COMMON,
"Received hello from %s on %s should be ignored as that this version of FRR does not know how to properly handle interval == 0",
format_address(from), ifp->name);
- continue;
+ goto done;
}
changed = update_neighbour(neigh, seqno, interval);
diff --git a/bgpd/bgp_label.c b/bgpd/bgp_label.c
index 0cad119af1..414dafebd4 100644
--- a/bgpd/bgp_label.c
+++ b/bgpd/bgp_label.c
@@ -297,6 +297,9 @@ static int bgp_nlri_get_labels(struct peer *peer, uint8_t *pnt, uint8_t plen,
uint8_t llen = 0;
uint8_t label_depth = 0;
+ if (plen < BGP_LABEL_BYTES)
+ return 0;
+
for (; data < lim; data += BGP_LABEL_BYTES) {
memcpy(label, data, BGP_LABEL_BYTES);
llen += BGP_LABEL_BYTES;
@@ -359,6 +362,9 @@ int bgp_nlri_parse_label(struct peer *peer, struct attr *attr,
memcpy(&addpath_id, pnt, BGP_ADDPATH_ID_LEN);
addpath_id = ntohl(addpath_id);
pnt += BGP_ADDPATH_ID_LEN;
+
+ if (pnt >= lim)
+ return BGP_NLRI_PARSE_ERROR_PACKET_OVERFLOW;
}
/* Fetch prefix length. */
@@ -377,6 +383,13 @@ int bgp_nlri_parse_label(struct peer *peer, struct attr *attr,
/* Fill in the labels */
llen = bgp_nlri_get_labels(peer, pnt, psize, &label);
+ if (llen == 0) {
+ flog_err(
+ EC_BGP_UPDATE_RCV,
+ "%s [Error] Update packet error (wrong label length 0)",
+ peer->host);
+ return BGP_NLRI_PARSE_ERROR_LABEL_LENGTH;
+ }
p.prefixlen = prefixlen - BSIZE(llen);
/* There needs to be at least one label */
@@ -384,8 +397,6 @@ int bgp_nlri_parse_label(struct peer *peer, struct attr *attr,
flog_err(EC_BGP_UPDATE_RCV,
"%s [Error] Update packet error (wrong label length %d)",
peer->host, prefixlen);
- bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
- BGP_NOTIFY_UPDATE_INVAL_NETWORK);
return BGP_NLRI_PARSE_ERROR_LABEL_LENGTH;
}
diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c
index 5c68545398..25a4403040 100644
--- a/bgpd/rfapi/rfapi_import.c
+++ b/bgpd/rfapi/rfapi_import.c
@@ -874,33 +874,39 @@ static void rfapiImportTableFlush(struct rfapi_import_table *it)
for (afi = AFI_IP; afi < AFI_MAX; ++afi) {
struct agg_node *rn;
+ struct agg_table *at;
- for (rn = agg_route_top(it->imported_vpn[afi]); rn;
- rn = agg_route_next(rn)) {
- /*
- * Each route_node has:
- * aggregate: points to rfapi_it_extra with monitor
- * chain(s)
- * info: points to chain of bgp_path_info
- */
- /* free bgp_path_info and its children */
- rfapiBgpInfoChainFree(rn->info);
- rn->info = NULL;
+ at = it->imported_vpn[afi];
+ if (at) {
+ for (rn = agg_route_top(at); rn;
+ rn = agg_route_next(rn)) {
+ /*
+ * Each route_node has:
+ * aggregate: points to rfapi_it_extra with
+ * monitor chain(s)
+ * info: points to chain of bgp_path_info
+ */
+ /* free bgp_path_info and its children */
+ rfapiBgpInfoChainFree(rn->info);
+ rn->info = NULL;
- rfapiMonitorExtraFlush(SAFI_MPLS_VPN, rn);
+ rfapiMonitorExtraFlush(SAFI_MPLS_VPN, rn);
+ }
+ agg_table_finish(at);
}
- for (rn = agg_route_top(it->imported_encap[afi]); rn;
- rn = agg_route_next(rn)) {
- /* free bgp_path_info and its children */
- rfapiBgpInfoChainFree(rn->info);
- rn->info = NULL;
+ if (at) {
+ at = it->imported_encap[afi];
+ for (rn = agg_route_top(at); rn;
+ rn = agg_route_next(rn)) {
+ /* free bgp_path_info and its children */
+ rfapiBgpInfoChainFree(rn->info);
+ rn->info = NULL;
- rfapiMonitorExtraFlush(SAFI_ENCAP, rn);
+ rfapiMonitorExtraFlush(SAFI_ENCAP, rn);
+ }
+ agg_table_finish(at);
}
-
- agg_table_finish(it->imported_vpn[afi]);
- agg_table_finish(it->imported_encap[afi]);
}
if (it->monitor_exterior_orphans) {
skiplist_free(it->monitor_exterior_orphans);
@@ -4260,10 +4266,7 @@ void bgp_rfapi_destroy(struct bgp *bgp, struct rfapi *h)
h->resolve_nve_nexthop = NULL;
}
- agg_table_finish(h->it_ce->imported_vpn[AFI_IP]);
- agg_table_finish(h->it_ce->imported_vpn[AFI_IP6]);
- agg_table_finish(h->it_ce->imported_encap[AFI_IP]);
- agg_table_finish(h->it_ce->imported_encap[AFI_IP6]);
+ rfapiImportTableFlush(h->it_ce);
if (h->import_mac) {
struct rfapi_import_table *it;
diff --git a/doc/developer/cli.rst b/doc/developer/cli.rst
index 2a08531bd7..61b9cf6acb 100644
--- a/doc/developer/cli.rst
+++ b/doc/developer/cli.rst
@@ -177,29 +177,29 @@ parser, but this is merely a dumb copy job.
Here is a brief summary of the various token types along with examples.
-+-----------------+-------------------------+-------------------------------------------------------+
-| Token type | Syntax | Description |
-+=================+=========================+=======================================================+
-| ``WORD`` | ``show ip bgp`` | Matches itself. In the example every token is a WORD. |
-+-----------------+-------------------------+-------------------------------------------------------+
-| ``IPV4`` | ``A.B.C.D`` | Matches an IPv4 address. |
-+-----------------+-------------------------+-------------------------------------------------------+
-| ``IPV6`` | ``X:X::X:X`` | Matches an IPv6 address. |
-+-----------------+-------------------------+-------------------------------------------------------+
-| ``IPV4_PREFIX`` | ``A.B.C.D/M`` | Matches an IPv4 prefix in CIDR notation. |
-+-----------------+-------------------------+-------------------------------------------------------+
-| ``IPV6_PREFIX`` | ``X:X::X:X/M`` | Matches an IPv6 prefix in CIDR notation. |
-+-----------------+-------------------------+-------------------------------------------------------+
-| ``MAC`` | ``X:X:X:X:X:X`` | Matches a 48-bit mac address. |
-+-----------------+-------------------------+-------------------------------------------------------+
-| ``MAC_PREFIX`` | ``X:X:X:X:X:X/M`` | Matches a 48-bit mac address with a mask. |
-+-----------------+-------------------------+-------------------------------------------------------+
-| ``VARIABLE`` | ``FOOBAR`` | Matches anything. |
-+-----------------+-------------------------+-------------------------------------------------------+
-| ``RANGE`` | ``(X-Y)`` | Matches numbers in the range X..Y inclusive. |
-+-----------------+-------------------------+-------------------------------------------------------+
-| ``ASNUM`` | ``<A.B|(1-4294967295>`` | Matches an AS in plain or dot format. |
-+-----------------+-------------------------+-------------------------------------------------------+
++-----------------+--------------------------+-------------------------------------------------------+
+| Token type | Syntax | Description |
++=================+==========================+=======================================================+
+| ``WORD`` | ``show ip bgp`` | Matches itself. In the example every token is a WORD. |
++-----------------+--------------------------+-------------------------------------------------------+
+| ``IPV4`` | ``A.B.C.D`` | Matches an IPv4 address. |
++-----------------+--------------------------+-------------------------------------------------------+
+| ``IPV6`` | ``X:X::X:X`` | Matches an IPv6 address. |
++-----------------+--------------------------+-------------------------------------------------------+
+| ``IPV4_PREFIX`` | ``A.B.C.D/M`` | Matches an IPv4 prefix in CIDR notation. |
++-----------------+--------------------------+-------------------------------------------------------+
+| ``IPV6_PREFIX`` | ``X:X::X:X/M`` | Matches an IPv6 prefix in CIDR notation. |
++-----------------+--------------------------+-------------------------------------------------------+
+| ``MAC`` | ``X:X:X:X:X:X`` | Matches a 48-bit mac address. |
++-----------------+--------------------------+-------------------------------------------------------+
+| ``MAC_PREFIX`` | ``X:X:X:X:X:X/M`` | Matches a 48-bit mac address with a mask. |
++-----------------+--------------------------+-------------------------------------------------------+
+| ``VARIABLE`` | ``FOOBAR`` | Matches anything. |
++-----------------+--------------------------+-------------------------------------------------------+
+| ``RANGE`` | ``(X-Y)`` | Matches numbers in the range X..Y inclusive. |
++-----------------+--------------------------+-------------------------------------------------------+
+| ``ASNUM`` | ``<A.B|(1-4294967295)>`` | Matches an AS in plain or dot format. |
++-----------------+--------------------------+-------------------------------------------------------+
When presented with user input, the parser will search over all defined
commands in the current context to find a match. It is aware of the various
diff --git a/doc/developer/workflow.rst b/doc/developer/workflow.rst
index 835c1d1d99..f11fff5dee 100644
--- a/doc/developer/workflow.rst
+++ b/doc/developer/workflow.rst
@@ -95,7 +95,7 @@ March/July/November. Walking backwards from this date:
are considered lowest priority (regardless of when they were opened.)
- 4 weeks earlier, the stable branch separates from master (named
- ``dev/MAJOR.MINOR`` at this point) and tagged as ```base_X.Y``.
+ ``dev/MAJOR.MINOR`` at this point) and tagged as ``base_X.Y``.
Master is unfrozen and new features may again proceed.
Part of unfreezing master is editing the ``AC_INIT`` statement in
diff --git a/doc/user/bgp.rst b/doc/user/bgp.rst
index 1798f1ad2a..946f0699f2 100644
--- a/doc/user/bgp.rst
+++ b/doc/user/bgp.rst
@@ -2290,7 +2290,7 @@ Numbered Community Lists
^^^^^^^^^^^^^^^^^^^^^^^^
When number is used for BGP community list name, the number has
-special meanings. Community list number in the range from 1 and 99 is
+special meanings. Community list number in the range from 1 to 99 is
standard community list. Community list number in the range from 100
to 500 is expanded community list. These community lists are called
as numbered community lists. On the other hand normal community lists
diff --git a/ospf6d/ospf6_abr.c b/ospf6d/ospf6_abr.c
index 0575f5abe1..4def3c7386 100644
--- a/ospf6d/ospf6_abr.c
+++ b/ospf6d/ospf6_abr.c
@@ -1136,11 +1136,9 @@ void ospf6_abr_examin_summary(struct ospf6_lsa *lsa, struct ospf6_area *oa)
}
if (CHECK_FLAG(prefix_lsa->prefix.prefix_options,
- OSPF6_PREFIX_OPTION_NU)
- || CHECK_FLAG(prefix_lsa->prefix.prefix_options,
- OSPF6_PREFIX_OPTION_LA)) {
+ OSPF6_PREFIX_OPTION_NU)) {
if (is_debug)
- zlog_debug("Prefix has NU/LA bit set, ignore");
+ zlog_debug("Prefix has the NU bit set, ignore");
if (old)
ospf6_route_remove(old, table);
return;
@@ -1153,7 +1151,8 @@ void ospf6_abr_examin_summary(struct ospf6_lsa *lsa, struct ospf6_area *oa)
if (!OSPF6_OPT_ISSET(router_lsa->options, OSPF6_OPT_R)
|| !OSPF6_OPT_ISSET(router_lsa->options, OSPF6_OPT_V6)) {
if (is_debug)
- zlog_debug("Prefix has NU/LA bit set, ignore");
+ zlog_debug(
+ "Router-LSA has the V6-bit or R-bit unset, ignore");
if (old)
ospf6_route_remove(old, table);
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c
index 05275c52ea..b2cdbc9b57 100644
--- a/ospf6d/ospf6_asbr.c
+++ b/ospf6d/ospf6_asbr.c
@@ -1380,8 +1380,8 @@ ospf6_external_aggr_match(struct ospf6 *ospf6, struct prefix *p)
void ospf6_asbr_redistribute_add(int type, ifindex_t ifindex,
struct prefix *prefix,
unsigned int nexthop_num,
- struct in6_addr *nexthop, route_tag_t tag,
- struct ospf6 *ospf6)
+ const struct in6_addr *nexthop,
+ route_tag_t tag, struct ospf6 *ospf6)
{
route_map_result_t ret;
struct ospf6_route troute;
@@ -1469,9 +1469,13 @@ void ospf6_asbr_redistribute_add(int type, ifindex_t ifindex,
info->type = type;
- if (nexthop_num && nexthop)
+ if (nexthop_num && nexthop) {
ospf6_route_add_nexthop(match, ifindex, nexthop);
- else
+ if (!IN6_IS_ADDR_UNSPECIFIED(nexthop)
+ && !IN6_IS_ADDR_LINKLOCAL(nexthop))
+ memcpy(&info->forwarding, nexthop,
+ sizeof(struct in6_addr));
+ } else
ospf6_route_add_nexthop(match, ifindex, NULL);
match->path.origin.id = htonl(info->id);
@@ -1515,9 +1519,13 @@ void ospf6_asbr_redistribute_add(int type, ifindex_t ifindex,
}
info->type = type;
- if (nexthop_num && nexthop)
+ if (nexthop_num && nexthop) {
ospf6_route_add_nexthop(route, ifindex, nexthop);
- else
+ if (!IN6_IS_ADDR_UNSPECIFIED(nexthop)
+ && !IN6_IS_ADDR_LINKLOCAL(nexthop))
+ memcpy(&info->forwarding, nexthop,
+ sizeof(struct in6_addr));
+ } else
ospf6_route_add_nexthop(route, ifindex, NULL);
route = ospf6_route_add(route, ospf6->external_table);
diff --git a/ospf6d/ospf6_asbr.h b/ospf6d/ospf6_asbr.h
index 15982ca64c..d63e467278 100644
--- a/ospf6d/ospf6_asbr.h
+++ b/ospf6d/ospf6_asbr.h
@@ -114,7 +114,7 @@ extern int ospf6_asbr_is_asbr(struct ospf6 *o);
extern void ospf6_asbr_redistribute_add(int type, ifindex_t ifindex,
struct prefix *prefix,
unsigned int nexthop_num,
- struct in6_addr *nexthop,
+ const struct in6_addr *nexthop,
route_tag_t tag, struct ospf6 *ospf6);
extern void ospf6_asbr_redistribute_remove(int type, ifindex_t ifindex,
struct prefix *prefix,
diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c
index 72dfa240af..443032933d 100644
--- a/ospf6d/ospf6_route.c
+++ b/ospf6d/ospf6_route.c
@@ -267,7 +267,8 @@ int ospf6_num_nexthops(struct list *nh_list)
return (listcount(nh_list));
}
-void ospf6_add_nexthop(struct list *nh_list, int ifindex, struct in6_addr *addr)
+void ospf6_add_nexthop(struct list *nh_list, int ifindex,
+ const struct in6_addr *addr)
{
struct ospf6_nexthop *nh;
struct ospf6_nexthop nh_match;
diff --git a/ospf6d/ospf6_route.h b/ospf6d/ospf6_route.h
index 2d4fcc930e..c2125951ec 100644
--- a/ospf6d/ospf6_route.h
+++ b/ospf6d/ospf6_route.h
@@ -312,7 +312,7 @@ extern int ospf6_num_nexthops(struct list *nh_list);
extern void ospf6_copy_nexthops(struct list *dst, struct list *src);
extern void ospf6_merge_nexthops(struct list *dst, struct list *src);
extern void ospf6_add_nexthop(struct list *nh_list, int ifindex,
- struct in6_addr *addr);
+ const struct in6_addr *addr);
extern void ospf6_add_route_nexthop_blackhole(struct ospf6_route *route);
extern int ospf6_num_nexthops(struct list *nh_list);
extern bool ospf6_route_cmp_nexthops(struct ospf6_route *a,
diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c
index 6fe0a24926..0ccbb4d65d 100644
--- a/ospf6d/ospf6_zebra.c
+++ b/ospf6d/ospf6_zebra.c
@@ -252,7 +252,7 @@ static int ospf6_zebra_read_route(ZAPI_CALLBACK_ARGS)
{
struct zapi_route api;
unsigned long ifindex;
- struct in6_addr *nexthop;
+ const struct in6_addr *nexthop = &in6addr_any;
struct ospf6 *ospf6;
struct prefix_ipv6 p;
@@ -272,7 +272,9 @@ static int ospf6_zebra_read_route(ZAPI_CALLBACK_ARGS)
return 0;
ifindex = api.nexthops[0].ifindex;
- nexthop = &api.nexthops[0].gate.ipv6;
+ if (api.nexthops[0].type == NEXTHOP_TYPE_IPV6
+ || api.nexthops[0].type == NEXTHOP_TYPE_IPV6_IFINDEX)
+ nexthop = &api.nexthops[0].gate.ipv6;
if (IS_OSPF6_DEBUG_ZEBRA(RECV))
zlog_debug(
diff --git a/tests/topotests/conftest.py b/tests/topotests/conftest.py
index 2a57f6c26e..df5d066023 100755
--- a/tests/topotests/conftest.py
+++ b/tests/topotests/conftest.py
@@ -396,12 +396,7 @@ def pytest_runtest_setup(item):
def pytest_runtest_makereport(item, call):
"Log all assert messages to default logger with error level"
- # Nothing happened
- if call.when == "call":
- pause = topotest_extra_config["pause"]
- else:
- pause = False
-
+ pause = bool(item.config.getoption("--pause"))
title = "unset"
if call.excinfo is None: