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
F122599087: D29116.id85301.diff
Sun, Jul 6, 2:23 PM
Unknown Object (File)
Thu, Jun 26, 4:30 AM
Unknown Object (File)
Thu, Jun 26, 1:53 AM
Unknown Object (File)
Fri, Jun 20, 2:11 AM
Unknown Object (File)
Mon, Jun 16, 5:42 PM
Unknown Object (File)
Sun, Jun 15, 9:24 AM
Unknown Object (File)
Thu, Jun 12, 12:28 PM
Unknown Object (File)
Wed, Jun 11, 6:42 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