summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2014-01-13 09:48:13 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2014-01-13 09:48:13 +0000
commitbcd03669eecc43bae1390457f3f647630a006f1a (patch)
treed6354d05a775b473c3ea55d5965b8394690e4d2d
parentfb23f08c06cb6da49caac4e7996ce4c6904b9812 (diff)
Iterate over the per interface address list instead of the global one
in IFP_TO_IA(). ok bluhm@, henning@, mikeb@
-rw-r--r--sys/netinet/in_var.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/netinet/in_var.h b/sys/netinet/in_var.h
index ad7c833c470..91a233a1bab 100644
--- a/sys/netinet/in_var.h
+++ b/sys/netinet/in_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_var.h,v 1.31 2013/11/29 00:19:33 deraadt Exp $ */
+/* $OpenBSD: in_var.h,v 1.32 2014/01/13 09:48:12 mpi Exp $ */
/* $NetBSD: in_var.h,v 1.16 1996/02/13 23:42:15 christos Exp $ */
/*
@@ -88,9 +88,12 @@ extern struct in_ifaddrhead in_ifaddr;
/* struct ifnet *ifp; */ \
/* struct in_ifaddr *ia; */ \
do { \
- TAILQ_FOREACH((ia), &in_ifaddr, ia_list) \
- if ((ia)->ia_ifp == (ifp)) \
+ struct ifaddr *ifa; \
+ TAILQ_FOREACH(ifa, &(ifp)->if_addrlist, ifa_list) { \
+ if (ifa->ifa_addr->sa_family == AF_INET) \
break; \
+ } \
+ (ia) = ifatoia(ifa); \
} while (/* CONSTCOND */ 0)
#endif