mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-04 17:40:23 +00:00
Merge pull request #16936 from FRRouting/mergify/bp/stable/10.1/pr-16579
bgpd: Avoid use-after-free when doing `no router bgp` with auto created instances (backport #16579)
This commit is contained in:
commit
cf5b42e3fe
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user