summaryrefslogtreecommitdiffstats
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2008-12-17 04:33:52 +0000
committerkmacy <kmacy@FreeBSD.org>2008-12-17 04:33:52 +0000
commit832d8c0e290d1c9e734619e1791bbc98d5462f24 (patch)
tree6dfbf63dedf127cd45d70bc327dd230aa0a2caf8 /sys/net/if.c
parent253ef3d89725075cdb78929153fcc2eb31a8867c (diff)
downloadFreeBSD-src-832d8c0e290d1c9e734619e1791bbc98d5462f24.zip
FreeBSD-src-832d8c0e290d1c9e734619e1791bbc98d5462f24.tar.gz
avoid trying to acquire a shared lock while holding an exclusive lock
by making the ifnet lock acquisition exclusive
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 9f0b063..6e71f67 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -197,9 +197,9 @@ ifnet_byindex(u_short idx)
INIT_VNET_NET(curvnet);
struct ifnet *ifp;
- IFNET_RLOCK();
+ IFNET_WLOCK();
ifp = V_ifindex_table[idx].ife_ifnet;
- IFNET_RUNLOCK();
+ IFNET_WUNLOCK();
return (ifp);
}
@@ -218,9 +218,9 @@ ifaddr_byindex(u_short idx)
{
struct ifaddr *ifa;
- IFNET_RLOCK();
+ IFNET_WLOCK();
ifa = ifnet_byindex(idx)->if_addr;
- IFNET_RUNLOCK();
+ IFNET_WUNLOCK();
return (ifa);
}
OpenPOWER on IntegriCloud