summaryrefslogtreecommitdiffstats
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2009-04-23 11:51:53 +0000
committerrwatson <rwatson@FreeBSD.org>2009-04-23 11:51:53 +0000
commitccc05d4c7fc358ca3cc8339274b58835f1ba153b (patch)
tree00a3b8317138c3f76378e3a6003faf4f48043892 /sys/net/if.c
parentbf5b2167ac0cacf1ff816efc0f73ed8e20386341 (diff)
downloadFreeBSD-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.c5
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.
*/
OpenPOWER on IntegriCloud