vrf: fix loopback event leak on fini - #681
Conversation
iface_vrf_fini() returns early when netlink_vrf_del() fails, skipping iface_loopback_destroy() and leaking the loopback polling event. This happens whenever an address is configured on the VRF loopback: the route is already gone and netlink_vrf_del() fails with ESRCH. Always destroy the loopback and return the first error instead. Assisted-by: GitHub Copilot CLI:claude-opus-5 Signed-off-by: Christopher Dziomba <christopher.dziomba@telekom.de>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
When
netlink_vrf_del()fails,iface_vrf_fini()returns early and never callsiface_loopback_destroy(), leaking the loopback polling event allocated iniface_loopback_create().This is hit whenever an address is configured on a VRF loopback: by the time the VRF is deleted the route is already gone,
netlink_vrf_del()fails withESRCHand logsand LeakSanitizer reports
Found while writing the smoke test in #658, which is the first test to configure an address on the
mainVRF loopback.Fix VRF finalization leak
iface_vrf_fini().netlink_vrf_del()fails.iface_loopback_destroy()to release the polling event.