Fix race between ifconfig destroy and ARP timer.
authorbluhm <bluhm@openbsd.org>
Mon, 18 Dec 2023 13:30:44 +0000 (13:30 +0000)
committerbluhm <bluhm@openbsd.org>
Mon, 18 Dec 2023 13:30:44 +0000 (13:30 +0000)
commit73fb5aae645f3bc12746fd705a937dfc9f9abc01
treef9c23673da7822d7a69dc4b81b4b7f91ba80213b
parent5f231c1e4e35f39a1a30796044ba61b9e8c79833
Fix race between ifconfig destroy and ARP timer.

After if_detach() has called if_remove(), if_get() will return NULL.
Before if_detach() grabs the net lock, ARP timer can still run.  In
this case arptfree() should just return, instead of triggering an
assertion because ifp is NULL.  The ARP route will be deleted later
when in_ifdetach() calls in_purgeaddr().

OK kn@ mvs@ claudio@
sys/netinet/if_ether.c