Fix/zebra netns del
Fix two issues during netns deletion:
- Free global netlink message buffer only when zebra is shutting down (not when netns is deleted).
- Clean up queued dataplane update contexts which have references to the netns.
Can you say a bit about what the "issues" are: is there ... memory that's not freed? or ... something that's freed too soon, while it might still be used during shutdown?
@mjstapp
If netns VRF backend is enabled, kernel_terminate() is called when a netns (VRF) is deleted:
https://github.com/FRRouting/frr/blob/741d1d009042222c59b71db27ead08387cbe8cb0/zebra/zebra_ns.c#L144-L160
So don't free the global nl_batch_tx_buf here, and move that into kernel_router_terminate() instead.
For the second issue, if don't remove queued dataplane contexts, which has reference to netlink socket of the netns being deleted, there's a race between main (removal of netlink sock) and dataplane (handling of pending contexts) thread.
This PR is stale because it has been open 180 days with no activity. Comment or remove the autoclose label in order to avoid having this PR closed.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
Remove the first commit. An identical change is merged in #18309.