avoid trying to acquire a shared lock while holding an exclusive lock

by making the ifnet lock acquisition exclusive
This commit is contained in:
Kip Macy 2008-12-17 04:33:52 +00:00
parent 832fe6cbb7
commit c368cff776
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=186209

View File

@ -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);
}