summaryrefslogtreecommitdiffstats
path: root/sys/net/if_ef.c
diff options
context:
space:
mode:
authorhsu <hsu@FreeBSD.org>2002-12-22 05:35:03 +0000
committerhsu <hsu@FreeBSD.org>2002-12-22 05:35:03 +0000
commit82e1e3bab0d3abe1018a0b56559c154485f2f676 (patch)
treed0f9ee7e6f9d8014e6f8f94ab6965e85c268792e /sys/net/if_ef.c
parent2afef11c570b7b725c3145fc710f8dcd8d7ed4e0 (diff)
downloadFreeBSD-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.c5
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);
OpenPOWER on IntegriCloud