From 56a51f7edd1a0698bf51de7e195c12e374a4ca47 Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Thu, 15 Jun 2023 17:35:30 +0300 Subject: [PATCH 1/2] Revert "ripd: Cleanup memory allocations on shutdown" This reverts commit 3d1588d8ed537e3dbf120e1b2a5ad5b3c00c7897. This commit introduced a crash. When the VRF is deleted, the RIP instance should not be freed, because the NB infrastructure still stores the pointer to it. The instance should be deleted only when it's actually deleted from the configuration. To reproduce the crash: ``` frr# conf t frr(config)# vrf vrf1 frr(config-vrf)# exit frr(config)# router rip vrf vrf1 frr(config-router)# exit frr(config)# no vrf vrf1 frr(config)# no router rip vrf vrf1 vtysh: error reading from ripd: Resource temporarily unavailable (11)Warning: closing connection to ripd because of an I/O error! frr(config)# ``` Signed-off-by: Igor Ryzhov (cherry picked from commit 054ca9b9ee760e23ac5d9f8d26d50e8fca78a887) --- ripd/ripd.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ripd/ripd.c b/ripd/ripd.c index 8e02f1a6c185..8a321d9a91f3 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -3551,18 +3551,10 @@ static int rip_vrf_new(struct vrf *vrf) static int rip_vrf_delete(struct vrf *vrf) { - struct rip *rip; - if (IS_RIP_DEBUG_EVENT) zlog_debug("%s: VRF deleted: %s(%u)", __func__, vrf->name, vrf->vrf_id); - rip = rip_lookup_by_vrf_name(vrf->name); - if (!rip) - return 0; - - rip_clean(rip); - return 0; } From 6527233f29ee6ba9b26d631332d50cf4964f8ffa Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Thu, 15 Jun 2023 17:42:05 +0300 Subject: [PATCH 2/2] Revert "ripngd: Cleanup memory allocations on shutdown" This reverts commit b1d29673ca16e558aea5d632da181555c83980cf. This commit introduced a crash. When the VRF is deleted, the RIPNG instance should not be freed, because the NB infrastructure still stores the pointer to it. The instance should be deleted only when it's actually deleted from the configuration. To reproduce the crash: ``` frr# conf t frr(config)# vrf vrf1 frr(config-vrf)# exit frr(config)# router ripng vrf vrf1 frr(config-router)# exit frr(config)# no vrf vrf1 frr(config)# no router ripng vrf vrf1 vtysh: error reading from ripngd: Resource temporarily unavailable (11)Warning: closing connection to ripngd because of an I/O error! frr(config)# ``` Signed-off-by: Igor Ryzhov (cherry picked from commit 9f6dade90e5e4686f67ae17b42c2873ec7ca6532) --- ripngd/ripngd.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c index 755debd0a4ec..1e7a13d7dc61 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -2581,17 +2581,10 @@ static int ripng_vrf_new(struct vrf *vrf) static int ripng_vrf_delete(struct vrf *vrf) { - struct ripng *ripng; - if (IS_RIPNG_DEBUG_EVENT) zlog_debug("%s: VRF deleted: %s(%u)", __func__, vrf->name, vrf->vrf_id); - ripng = ripng_lookup_by_vrf_name(vrf->name); - if (!ripng) - return 0; - - ripng_clean(ripng); return 0; }