Page MenuHomeFreeBSD

Flush remaining routes from the routing table during VNET shutdown.
ClosedPublic

Authored by melifaro on Mar 7 2021, 6:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 13, 2:42 PM
Unknown Object (File)
Mar 15 2025, 4:32 PM
Unknown Object (File)
Mar 15 2025, 8:59 AM
Unknown Object (File)
Mar 5 2025, 7:02 PM
Unknown Object (File)
Feb 28 2025, 12:38 PM
Unknown Object (File)
Feb 28 2025, 11:30 AM
Unknown Object (File)
Feb 23 2025, 4:44 PM
Unknown Object (File)
Feb 23 2025, 4:03 AM
Subscribers

Details

Summary

This fixes rtentry leak for the cloned interfaces created inside the
VNET.

PR: 253998
Reported by: rashey at superbox.pl
MFC after: 3 days

Current code cleans up protocol state in ip[6]_destroy(). It includes flushing route entries on a per-interface basis using rt_flushifroutes_af(). The latter function removes all interface routes except ones with RTF_PINNED flag (e.g. interface routes).
As a result, some of the rtentries may leak.

Add rib_flush_routes_af() which removes all of the routes for the specified family in a light-weight fashion and switch IPv4/IPv6 stack teardown to use it instead of iterating over all interfaces with rt_flushroutes_af().

Test Plan
# kyua test -k /usr/tests/sys/netpfil/pf/Kyuafile set_skip:set_skip_group_lo
set_skip:set_skip_group_lo  ->  passed  [0.053s]
tail -n 200 /var/log/messages | grep rtentry
#

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 37685
Build 34574: arc lint + arc unit

Event Timeline

melifaro edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.Mar 8 2021, 10:37 AM
melifaro edited the summary of this revision. (Show Details)
melifaro edited the test plan for this revision. (Show Details)

Implement a cleaner fix.

This revision now requires review to proceed.Mar 8 2021, 11:21 PM
This revision is now accepted and ready to land.Mar 9 2021, 10:51 AM