diff options
| -rw-r--r-- | doc/developer/topotests.rst | 9 | ||||
| -rw-r--r-- | doc/user/pim.rst | 22 | ||||
| -rw-r--r-- | lib/agentx.c | 9 | ||||
| -rw-r--r-- | pathd/pathd.c | 15 | ||||
| -rw-r--r-- | tests/topotests/bgp_duplicate_nexthop/test_bgp_duplicate_nexthop.py | 2 | ||||
| -rw-r--r-- | tests/topotests/lib/topotest.py | 4 | ||||
| -rw-r--r-- | zebra/rt_netlink.c | 2 | ||||
| -rw-r--r-- | zebra/zapi_msg.c | 18 | ||||
| -rw-r--r-- | zebra/zapi_msg.h | 2 | ||||
| -rw-r--r-- | zebra/zebra_rib.c | 10 | ||||
| -rw-r--r-- | zebra/zebra_rnh.c | 2 |
11 files changed, 61 insertions, 34 deletions
diff --git a/doc/developer/topotests.rst b/doc/developer/topotests.rst index eaa8e38a9c..52c0361a02 100644 --- a/doc/developer/topotests.rst +++ b/doc/developer/topotests.rst @@ -1340,6 +1340,15 @@ Example: router.load_config(TopoRouter.RD_ZEBRA, "zebra.conf") router.load_config(TopoRouter.RD_OSPF) +or using unified config (specifying which daemons to run is optional): + +.. code:: py + + for _, (rname, router) in enumerate(router_list.items(), 1): + router.load_frr_config(os.path.join(CWD, "{}/frr.conf".format(rname)), [ + TopoRouter.RD_ZEBRA + TopoRouter.RD_MGMTD, + TopoRouter.RD_BGP]) - The topology definition or build function 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/tests/topotests/lib/topotest.py b/tests/topotests/lib/topotest.py index 1d4bc2eac6..5a8c2e5964 100644 --- a/tests/topotests/lib/topotest.py +++ b/tests/topotests/lib/topotest.py @@ -1430,7 +1430,7 @@ class Router(Node): self.daemondir = None self.hasmpls = False self.routertype = "frr" - self.unified_config = None + self.unified_config = False self.daemons = { "zebra": 0, "ripd": 0, @@ -1653,7 +1653,7 @@ class Router(Node): # print "Daemons before:", self.daemons if daemon in self.daemons.keys() or daemon == "frr": if daemon == "frr": - self.unified_config = 1 + self.unified_config = True else: self.daemons[daemon] = 1 if param is not None: 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, |
