diff options
author | bz <bz@FreeBSD.org> | 2010-04-11 11:49:24 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2010-04-11 11:49:24 +0000 |
commit | 674a87c918aac879260de667e43372e3fe9b355b (patch) | |
tree | a0455138226fc744eb902dfe4d6f2c643ec9468e /sys/net/if.c | |
parent | 5dedc24a42a2dcb98d0db2a8ea0c7501e86ab8db (diff) | |
download | FreeBSD-src-674a87c918aac879260de667e43372e3fe9b355b.zip FreeBSD-src-674a87c918aac879260de667e43372e3fe9b355b.tar.gz |
In if_detach_internal() only try to do the detach run if if_attachdomain1()
has actually succeeded to initialize and attach. There is a theoretical
possibility to drop out early in if_attachdomain1() leaving the array
uninitialized if we cannot get the lock.
Discussed with: rwatson
MFC after: 10 days
Diffstat (limited to 'sys/net/if.c')
-rw-r--r-- | sys/net/if.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 38b1d50..1cdc20b 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -898,7 +898,7 @@ if_detach_internal(struct ifnet *ifp, int vmove) if_delgroups(ifp); IF_AFDATA_LOCK(ifp); - for (dp = domains; dp; dp = dp->dom_next) { + for (dp = domains; ifp->if_afdata_initialized > 0 && dp; dp = dp->dom_next) { if (dp->dom_ifdetach && ifp->if_afdata[dp->dom_family]) (*dp->dom_ifdetach)(ifp, ifp->if_afdata[dp->dom_family]); |