summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_vty.c9
-rw-r--r--doc/developer/topotests.rst8
-rw-r--r--doc/developer/workflow.rst8
-rw-r--r--doc/user/pim.rst22
-rw-r--r--lib/agentx.c9
-rw-r--r--pathd/pathd.c15
-rw-r--r--tests/topotests/bgp_duplicate_nexthop/test_bgp_duplicate_nexthop.py2
-rw-r--r--zebra/rt_netlink.c2
-rw-r--r--zebra/zapi_msg.c18
-rw-r--r--zebra/zapi_msg.h2
-rw-r--r--zebra/zebra_rib.c10
-rw-r--r--zebra/zebra_rnh.c2
12 files changed, 72 insertions, 35 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 43e267c5e8..c9c7b80496 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -1695,15 +1695,18 @@ DEFUN (no_router_bgp,
/* Cannot delete default instance if vrf instances exist */
if (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT) {
- struct listnode *node;
+ struct listnode *node, *nnode;
struct bgp *tmp_bgp;
- for (ALL_LIST_ELEMENTS_RO(bm->bgp, node, tmp_bgp)) {
+ for (ALL_LIST_ELEMENTS(bm->bgp, node, nnode, tmp_bgp)) {
if (tmp_bgp->inst_type != BGP_INSTANCE_TYPE_VRF)
continue;
- if (CHECK_FLAG(tmp_bgp->vrf_flags, BGP_VRF_AUTO))
+ if (CHECK_FLAG(tmp_bgp->vrf_flags,
+ BGP_VRF_AUTO)) {
bgp_delete(tmp_bgp);
+ continue;
+ }
if (CHECK_FLAG(
tmp_bgp->af_flags[AFI_IP]
diff --git a/doc/developer/topotests.rst b/doc/developer/topotests.rst
index 66946f6c37..52c0361a02 100644
--- a/doc/developer/topotests.rst
+++ b/doc/developer/topotests.rst
@@ -411,6 +411,14 @@ for ``master`` branch:
and create ``frr`` user and ``frrvty`` group as shown above.
+Newer versions of Address Sanitizers require a sysctl to be changed
+to allow for the tests to be successfully run. This is also true
+for Undefined behavior Sanitizers as well as Memory Sanitizer.
+
+.. code:: shell
+
+ sysctl vm.mmap_rnd_bits=28
+
Debugging Topotest Failures
^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/doc/developer/workflow.rst b/doc/developer/workflow.rst
index 166c96da33..a6bdec1e5b 100644
--- a/doc/developer/workflow.rst
+++ b/doc/developer/workflow.rst
@@ -1325,6 +1325,14 @@ but are no longer actively maintained. MemorySanitizer is not available in GCC.
The different Sanitizers are mostly incompatible with each other. Please
refer to GCC/LLVM documentation for details.
+.. note::
+
+ The different sanitizers also require setting
+
+ sysctl vm.mmap_rnd_bits=28
+
+ in order to work properly.
+
frr-format plugin
This is a GCC plugin provided with FRR that does extended type checks for
``%pFX``-style printfrr extensions. To use this plugin,
diff --git a/doc/user/pim.rst b/doc/user/pim.rst
index d8e52f471e..1740828f26 100644
--- a/doc/user/pim.rst
+++ b/doc/user/pim.rst
@@ -59,6 +59,7 @@ PIM Routers
-----------
.. clicmd:: router pim [vrf NAME]
+
Configure global PIM protocol
.. clicmd:: rp A.B.C.D A.B.C.D/M
@@ -159,6 +160,9 @@ PIM Routers
Global Multicast
----------------
+These commands are valid at the top-level of the configuration (or also per
+vrf where indicated), instead of under the 'router pim' submode.
+
.. clicmd:: ip multicast rpf-lookup-mode WORD
Modify how PIM does RPF lookups in the zebra routing table. You can use
@@ -343,10 +347,13 @@ MSDP can be setup in different ways:
.. note::
MSDP default peer is not implemented.
- MSDP configuration is available under 'router pim'
+Commands available for MSDP
+---------------------------
+
+.. note::
-Commands available for MSDP:
+ MSDP configuration is available under 'router pim'.
.. clicmd:: msdp timers (1-65535) (1-65535) [(1-65535)]
@@ -415,15 +422,9 @@ cause great confusion.
.. clicmd:: show ip igmp [vrf NAME] join [json]
- Display IGMP static join information for a specific vrf.
-
-.. index:: show ip igmp [vrf NAME$vrf_name] groups [INTERFACE$ifname [GROUP$grp_str]] [detail] [json$json]
-.. clicmd:: show ip igmp [vrf NAME$vrf_name] groups [INTERFACE$ifname [GROUP$grp_str]] [detail] [json$json]
-
- Display IGMP static join information for all the vrfs present.
+ Display IGMP static join information.
-.. index:: show ip igmp vrf all groups [GROUP$grp_str] [detail$detail] [json$json]
-.. clicmd:: show ip igmp vrf all groups [GROUP$grp_str] [detail$detail] [json$json]
+.. clicmd:: show ip igmp [vrf NAME] groups [INTERFACE [GROUP]] [detail] [json]
Display IGMP groups information.
@@ -788,4 +789,3 @@ Sample configuration
interface eth0
ip pim ssm
ip igmp
-
diff --git a/lib/agentx.c b/lib/agentx.c
index 2e621d06a4..2a3ff2355e 100644
--- a/lib/agentx.c
+++ b/lib/agentx.c
@@ -377,9 +377,16 @@ void smux_events_update(void)
agentx_events_update();
}
+static void smux_events_delete_thread(void *arg)
+{
+ XFREE(MTYPE_TMP, arg);
+}
+
void smux_terminate(void)
{
- if (events)
+ if (events) {
+ events->del = smux_events_delete_thread;
list_delete(&events);
+ }
}
#endif /* SNMP_AGENTX */
diff --git a/pathd/pathd.c b/pathd/pathd.c
index 6c13503c7d..9bb7dbae84 100644
--- a/pathd/pathd.c
+++ b/pathd/pathd.c
@@ -148,6 +148,16 @@ void srte_segment_list_del(struct srte_segment_list *segment_list)
XFREE(MTYPE_PATH_SEGMENT_LIST, segment_list);
}
+static void srte_segment_list_terminate(void)
+{
+ while (!RB_EMPTY(srte_segment_list_head, &srte_segment_lists)) {
+ struct srte_segment_list *sl = RB_ROOT(srte_segment_list_head,
+ &srte_segment_lists);
+
+ srte_segment_list_del(sl);
+ }
+}
+
/**
* Search for a segment list by name.
*
@@ -1281,6 +1291,11 @@ void pathd_shutdown(void)
{
path_ted_teardown();
srte_clean_zebra();
+
+ srte_segment_list_terminate();
+
+ vrf_terminate();
+
frr_fini();
}
diff --git a/tests/topotests/bgp_duplicate_nexthop/test_bgp_duplicate_nexthop.py b/tests/topotests/bgp_duplicate_nexthop/test_bgp_duplicate_nexthop.py
index b458c64e33..5c125869e2 100644
--- a/tests/topotests/bgp_duplicate_nexthop/test_bgp_duplicate_nexthop.py
+++ b/tests/topotests/bgp_duplicate_nexthop/test_bgp_duplicate_nexthop.py
@@ -7,7 +7,7 @@
# Copyright 2024 6WIND S.A.
#
-"""
+r"""
test_bgp_nhg_duplicate_nexthop.py:
Check that the FRR BGP daemon on r1 selects updates with same nexthops
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 01b527ea80..768090badb 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -1040,7 +1040,7 @@ int netlink_route_change_read_unicast_internal(struct nlmsghdr *h,
zlog_err(
"%s: %pFX multipath RTM_NEWROUTE has a invalid nexthop group from the kernel",
__func__, &p);
- XFREE(MTYPE_RE, re);
+ zebra_rib_route_entry_free(re);
}
} else {
if (ctx) {
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c
index 654ade8063..aecbba2ebc 100644
--- a/zebra/zapi_msg.c
+++ b/zebra/zapi_msg.c
@@ -2148,7 +2148,7 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)
__func__, &api.prefix,
zebra_route_string(client->proto));
- XFREE(MTYPE_RE, re);
+ zebra_rib_route_entry_free(re);
return;
}
@@ -2173,7 +2173,7 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)
nexthop_group_delete(&ng);
zebra_nhg_backup_free(&bnhg);
- XFREE(MTYPE_RE, re);
+ zebra_rib_route_entry_free(re);
return;
}
@@ -2192,8 +2192,7 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)
__func__);
nexthop_group_delete(&ng);
zebra_nhg_backup_free(&bnhg);
- XFREE(MTYPE_RE_OPAQUE, re->opaque);
- XFREE(MTYPE_RE, re);
+ zebra_rib_route_entry_free(re);
return;
}
if (CHECK_FLAG(api.message, ZAPI_MESSAGE_SRCPFX))
@@ -2205,8 +2204,7 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)
__func__, api.safi);
nexthop_group_delete(&ng);
zebra_nhg_backup_free(&bnhg);
- XFREE(MTYPE_RE_OPAQUE, re->opaque);
- XFREE(MTYPE_RE, re);
+ zebra_rib_route_entry_free(re);
return;
}
@@ -2235,8 +2233,7 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)
*/
if (ret == -1) {
client->error_cnt++;
- XFREE(MTYPE_RE_OPAQUE, re->opaque);
- XFREE(MTYPE_RE, re);
+ zebra_rib_route_entry_free(re);
}
/* At this point, these allocations are not needed: 're' has been
@@ -2264,9 +2261,10 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)
}
}
-void zapi_re_opaque_free(struct re_opaque *opaque)
+void zapi_re_opaque_free(struct route_entry *re)
{
- XFREE(MTYPE_RE_OPAQUE, opaque);
+ XFREE(MTYPE_RE_OPAQUE, re->opaque);
+ re->opaque = NULL;
}
static void zread_route_del(ZAPI_HANDLER_ARGS)
diff --git a/zebra/zapi_msg.h b/zebra/zapi_msg.h
index 9e3ea6fb6e..a59ccc838b 100644
--- a/zebra/zapi_msg.h
+++ b/zebra/zapi_msg.h
@@ -106,7 +106,7 @@ extern int zsend_client_close_notify(struct zserv *client,
int zsend_nhg_notify(uint16_t type, uint16_t instance, uint32_t session_id,
uint32_t id, enum zapi_nhg_notify_owner note);
-extern void zapi_re_opaque_free(struct re_opaque *opaque);
+extern void zapi_re_opaque_free(struct route_entry *re);
extern int zsend_zebra_srv6_locator_add(struct zserv *client,
struct srv6_locator *loc);
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 0f02b0a2ec..59190e9dd3 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -2696,8 +2696,7 @@ static void early_route_memory_free(struct zebra_early_route *ere)
if (ere->re_nhe)
zebra_nhg_free(ere->re_nhe);
- zapi_re_opaque_free(ere->re->opaque);
- XFREE(MTYPE_RE, ere->re);
+ zebra_rib_route_entry_free(ere->re);
XFREE(MTYPE_WQ_WRAPPER, ere);
}
@@ -4070,9 +4069,7 @@ void rib_unlink(struct route_node *rn, struct route_entry *re)
rib_re_nhg_free(re);
- zapi_re_opaque_free(re->opaque);
-
- XFREE(MTYPE_RE, re);
+ zebra_rib_route_entry_free(re);
}
void rib_delnode(struct route_node *rn, struct route_entry *re)
@@ -4319,6 +4316,7 @@ struct route_entry *zebra_rib_route_entry_new(vrf_id_t vrf_id, int type,
void zebra_rib_route_entry_free(struct route_entry *re)
{
+ zapi_re_opaque_free(re);
XFREE(MTYPE_RE, re);
}
@@ -4389,7 +4387,7 @@ int rib_add_multipath(afi_t afi, safi_t safi, struct prefix *p,
/* In error cases, free the route also */
if (ret < 0)
- XFREE(MTYPE_RE, re);
+ zebra_rib_route_entry_free(re);
return ret;
}
diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c
index bff8258879..303a81bb3e 100644
--- a/zebra/zebra_rnh.c
+++ b/zebra/zebra_rnh.c
@@ -826,7 +826,7 @@ static void free_state(vrf_id_t vrf_id, struct route_entry *re,
/* free RE and nexthops */
zebra_nhg_free(re->nhe);
- XFREE(MTYPE_RE, re);
+ zebra_rib_route_entry_free(re);
}
static void copy_state(struct rnh *rnh, const struct route_entry *re,