HomeFreeBSD

Flush remaining routes from the routing table during VNET shutdown.

Description

Flush remaining routes from the routing table during VNET shutdown.

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

Loopback teardown order is SI_SUB_INIT_IF, which happens after SI_SUB_PROTO_DOMAIN (route table teardown).
Thus, any route table operations are too late to schedule.
As the intent of the vnet teardown procedures to minimise the amount of effort by doing global cleanups instead of per-interface ones, address this by adding a relatively light-weight routing table cleanup function, rib_flush_routes().
It removes all remaining routes from the routing table and schedules the deletion, which will happen later, when rtables_destroy() waits for the current epoch to finish.

Test Plan:

set_skip:set_skip_group_lo  ->  passed  [0.053s]
tail -n 200 /var/log/messages | grep rtentry

Reviewers: network, kp, bz

Reviewed By: kp

Subscribers: imp, ae

Differential Revision: https://reviews.freebsd.org/D29116

Details

Provenance
melifaroAuthored on Mar 8 2021, 9:35 PM
Reviewer
kp
Differential Revision
D29116: Flush remaining routes from the routing table during VNET shutdown.
Parents
rG3fa034210c75: ktls: Fix non-inplace TLS 1.3 encryption.
Branches
Unknown
Tags
Unknown