When traversing global in_ifaddr list in the IFP_TO_IA() macro, we need

to obtain IN_IFADDR_RLOCK().
This commit is contained in:
glebius 2012-07-18 08:41:00 +00:00
parent de6625db1c
commit 636d3aa68f

View File

@ -161,14 +161,16 @@ do { \
#define IFP_TO_IA(ifp, ia) \
/* struct ifnet *ifp; */ \
/* struct in_ifaddr *ia; */ \
{ \
do { \
IN_IFADDR_RLOCK(); \
for ((ia) = TAILQ_FIRST(&V_in_ifaddrhead); \
(ia) != NULL && (ia)->ia_ifp != (ifp); \
(ia) = TAILQ_NEXT((ia), ia_link)) \
continue; \
if ((ia) != NULL) \
ifa_ref(&(ia)->ia_ifa); \
}
IN_IFADDR_RUNLOCK(); \
} while (0)
#endif
/*