diff options
author | rwatson <rwatson@FreeBSD.org> | 2009-04-23 11:51:53 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2009-04-23 11:51:53 +0000 |
commit | ccc05d4c7fc358ca3cc8339274b58835f1ba153b (patch) | |
tree | 00a3b8317138c3f76378e3a6003faf4f48043892 /sys/net/if.c | |
parent | bf5b2167ac0cacf1ff816efc0f73ed8e20386341 (diff) | |
download | FreeBSD-src-ccc05d4c7fc358ca3cc8339274b58835f1ba153b.zip FreeBSD-src-ccc05d4c7fc358ca3cc8339274b58835f1ba153b.tar.gz |
During if_detach(), invoke if_dead() to set the ifnet's function
pointers to "dead" implementations that no-op rather than invoking
the device driver. This would generally be unexpected and
possibly quite badly handled by most device drivers after
if_detach() has completed.
Reviewed by: bms
MFC after: 3 weeks
Diffstat (limited to 'sys/net/if.c')
-rw-r--r-- | sys/net/if.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 54cd916..f116f55 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -929,6 +929,11 @@ if_detach(struct ifnet *ifp) if_purgemaddrs(ifp); /* + * Prevent further calls into the device driver via ifnet. + */ + if_dead(ifp); + + /* * Remove link ifaddr pointer and maybe decrement if_index. * Clean up all addresses. */ |