]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r345180, r345187: if_bridge(4): Fix module teardown
authorkevans <kevans@FreeBSD.org>
Tue, 16 Apr 2019 20:56:51 +0000 (20:56 +0000)
committerkevans <kevans@FreeBSD.org>
Tue, 16 Apr 2019 20:56:51 +0000 (20:56 +0000)
commitaea19c1a2d749cc41983b29759b8199d74a82762
tree280f223ab7e7fb36318c027cc23da168f781ed4a
parentfdb9623c7cfda88413d489642a8da684183ef68d
MFC r345180, r345187: if_bridge(4): Fix module teardown

r345180: if_bridge(4): Fix module teardown

bridge_rtnode_zone still has outstanding allocations at the time of
destruction in the current model because all of the interface teardown
happens in a VNET_SYSUNINIT, -after- the MOD_UNLOAD has already been
processed.  The SYSUNINIT triggers destruction of the interfaces, which then
attempts to free the memory from the zone that's already been destroyed, and
we hit a panic.

Solve this by virtualizing the uma_zone we allocate the rtnodes from to fix
the ordering. bridge_rtable_fini should also take care to flush any
remaining routes that weren't taken care of when dynamic routes were flushed
in bridge_stop.

r345187: bridge: Fix STP-related panic

After r345180 we need to have the appropriate vnet context set to delete an
rtnode in bridge_rtnode_destroy().
That's usually the case, but not when it's called by the STP code (through
bstp_notify_rtage()).

We have to set the vnet context in bridge_rtable_expire() just as we do in the
other STP callback bridge_state_change().
sys/net/if_bridge.c