]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
if_gif: fix vnet shutdown panic
authorKristof Provost <kp@FreeBSD.org>
Thu, 4 Nov 2021 17:05:58 +0000 (18:05 +0100)
committerKristof Provost <kp@FreeBSD.org>
Mon, 8 Nov 2021 11:00:00 +0000 (12:00 +0100)
commit8ca6c11a7cf834721c03cbe1a1aab0a17bae4d4d
treed83c339227840060da7f5ab101ab74782ba70a9e
parent55b0acc0928ad9a4dc375802d3eb28ea1e7ebf80
if_gif: fix vnet shutdown panic

If an if_gif exists and has an address assigned inside a vnet when the
vnet is shut down we failed to clean up the address, leading to a panic
when we ip_destroy() and the V_in_ifaddrhashtbl is not empty.

This happens because of the VNET_SYS(UN)INIT order, which means we
destroy the if_gif interface before the addresses can be purged (and
if_detach() does not remove addresses, it assumes this will be done by
the stack teardown code).

Set subsystem SI_SUB_PSEUDO just like if_bridge so the cleanup
operations happen in the correct order.

MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D32835
sys/net/if_gif.c