Author: glebius
Date: Wed Jul 18 08:41:00 2012
New Revision: 238572
URL: http://svn.freebsd.org/changeset/base/238572

Log:
  When traversing global in_ifaddr list in the IFP_TO_IA() macro, we need
  to obtain IN_IFADDR_RLOCK().

Modified:
  head/sys/netinet/in_var.h

Modified: head/sys/netinet/in_var.h
==============================================================================
--- head/sys/netinet/in_var.h   Wed Jul 18 08:37:08 2012        (r238571)
+++ head/sys/netinet/in_var.h   Wed Jul 18 08:41:00 2012        (r238572)
@@ -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
 
 /*
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to