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)
Feb 4 2024, 4:44 AM
Unknown Object (File)
Jan 31 2024, 1:12 AM
Unknown Object (File)
Jan 18 2024, 1:16 PM
Unknown Object (File)
Jan 11 2024, 7:48 AM
Unknown Object (File)
Jan 11 2024, 12:33 AM
Unknown Object (File)
Jan 5 2024, 5:42 PM
Unknown Object (File)
Dec 27 2023, 11:05 PM
Unknown Object (File)
Dec 23 2023, 2:36 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