diff options
author | hsu <hsu@FreeBSD.org> | 2002-12-22 05:35:03 +0000 |
---|---|---|
committer | hsu <hsu@FreeBSD.org> | 2002-12-22 05:35:03 +0000 |
commit | 82e1e3bab0d3abe1018a0b56559c154485f2f676 (patch) | |
tree | d0f9ee7e6f9d8014e6f8f94ab6965e85c268792e /sys/net/if_ef.c | |
parent | 2afef11c570b7b725c3145fc710f8dcd8d7ed4e0 (diff) | |
download | FreeBSD-src-82e1e3bab0d3abe1018a0b56559c154485f2f676.zip FreeBSD-src-82e1e3bab0d3abe1018a0b56559c154485f2f676.tar.gz |
SMP locking for ifnet list.
Diffstat (limited to 'sys/net/if_ef.c')
-rw-r--r-- | sys/net/if_ef.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/net/if_ef.c b/sys/net/if_ef.c index d297faf..b064d38 100644 --- a/sys/net/if_ef.c +++ b/sys/net/if_ef.c @@ -163,8 +163,9 @@ ef_detach(struct efnet *sc) } } } - + IFNET_WLOCK(); TAILQ_REMOVE(&ifnet, ifp, if_link); + IFNET_WUNLOCK(); splx(s); return 0; } @@ -508,6 +509,7 @@ ef_load(void) struct ef_link *efl = NULL; int error = 0, d; + IFNET_RLOCK(); TAILQ_FOREACH(ifp, &ifnet, if_link) { if (ifp->if_type != IFT_ETHER) continue; EFDEBUG("Found interface %s%d\n", ifp->if_name, ifp->if_unit); @@ -538,6 +540,7 @@ ef_load(void) efcount++; SLIST_INSERT_HEAD(&efdev, efl, el_next); } + IFNET_RUNLOCK(); if (error) { if (efl) SLIST_INSERT_HEAD(&efdev, efl, el_next); |