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/netatm | |
parent | 2afef11c570b7b725c3145fc710f8dcd8d7ed4e0 (diff) | |
download | FreeBSD-src-82e1e3bab0d3abe1018a0b56559c154485f2f676.zip FreeBSD-src-82e1e3bab0d3abe1018a0b56559c154485f2f676.tar.gz |
SMP locking for ifnet list.
Diffstat (limited to 'sys/netatm')
-rw-r--r-- | sys/netatm/atm_if.c | 2 | ||||
-rw-r--r-- | sys/netatm/atm_usrreq.c | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/sys/netatm/atm_if.c b/sys/netatm/atm_if.c index 2065312..e5fdb6b 100644 --- a/sys/netatm/atm_if.c +++ b/sys/netatm/atm_if.c @@ -875,7 +875,9 @@ atm_nif_detach(nip) /* * Remove from system interface list (ie. if_detach()) */ + IFNET_WLOCK(); TAILQ_REMOVE(&ifnet, ifp, if_link); + IFNET_WUNLOCK(); /* * Remove from physical interface list diff --git a/sys/netatm/atm_usrreq.c b/sys/netatm/atm_usrreq.c index 4abc66b..e050b6c 100644 --- a/sys/netatm/atm_usrreq.c +++ b/sys/netatm/atm_usrreq.c @@ -394,6 +394,7 @@ atm_dgram_control(so, cmd, data, ifp, td) /* * Make sure prefix name is unique */ + IFNET_RLOCK(); TAILQ_FOREACH(ifp2, &ifnet, if_link) { if (!strcmp(ifp2->if_name, asp->asr_nif_pref)) { /* @@ -407,9 +408,11 @@ atm_dgram_control(so, cmd, data, ifp, td) } if (nip) continue; + IFNET_RUNLOCK(); ATM_RETERR(EEXIST); } } + IFNET_RUNLOCK(); /* * Let interface handle it from here |