From 385ba46174f49583a51f497870da8b381820bd92 Mon Sep 17 00:00:00 2001 From: mpi Date: Mon, 13 Jan 2014 09:48:12 +0000 Subject: [PATCH] Iterate over the per interface address list instead of the global one in IFP_TO_IA(). ok bluhm@, henning@, mikeb@ --- sys/netinet/in_var.h | 9 ++++++--- 1 file 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 -- 2.20.1