Skip to content

Commit

Permalink
Revert "ripngd: Cleanup memory allocations on shutdown"
Browse files Browse the repository at this point in the history
This reverts commit b1d2967.

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 <[email protected]>
  • Loading branch information
idryzhov committed Jun 15, 2023
1 parent 054ca9b commit 9f6dade
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions ripngd/ripngd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2624,17 +2624,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;
}

Expand Down

0 comments on commit 9f6dade

Please sign in to comment.