diff options
author | Kip Macy <kmacy@FreeBSD.org> | 2008-12-17 04:33:52 +0000 |
---|---|---|
committer | Kip Macy <kmacy@FreeBSD.org> | 2008-12-17 04:33:52 +0000 |
commit | c368cff776c1b8dc3e4e9e748c3c641683c99c80 (patch) | |
tree | 6dfbf63dedf127cd45d70bc327dd230aa0a2caf8 /sys | |
parent | 832fe6cbb756796fbd86a62a32603a6d7da7ba0f (diff) | |
download | src-c368cff776c1b8dc3e4e9e748c3c641683c99c80.tar.gz src-c368cff776c1b8dc3e4e9e748c3c641683c99c80.zip |
avoid trying to acquire a shared lock while holding an exclusive lock
by making the ifnet lock acquisition exclusive
Notes
Notes:
svn path=/head/; revision=186209
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 9f0b0630c616..6e71f67db37a 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); } |