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)
Sep 30 2024, 1:36 AM
Unknown Object (File)
Sep 24 2024, 8:23 PM
Unknown Object (File)
Sep 24 2024, 7:23 AM
Unknown Object (File)
Sep 23 2024, 3:11 PM
Unknown Object (File)
Sep 22 2024, 7:35 AM
Unknown Object (File)
Sep 20 2024, 1:10 PM
Unknown Object (File)
Sep 19 2024, 12:11 PM
Unknown Object (File)
Sep 11 2024, 4:11 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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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