diff --git a/sys/netinet/in_var.h b/sys/netinet/in_var.h index d35c3480eef1..50f144828c54 100644 --- a/sys/netinet/in_var.h +++ b/sys/netinet/in_var.h @@ -1,4 +1,4 @@ -/* $NetBSD: in_var.h,v 1.32 1998/12/19 02:46:12 thorpej Exp $ */ +/* $NetBSD: in_var.h,v 1.33 1999/05/03 22:12:45 thorpej Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -144,13 +144,17 @@ void in_socktrim __P((struct sockaddr_in *)); /* * Macro for finding whether an internet address (in_addr) belongs to one * of our interfaces (in_ifaddr). NULL if the address isn't ours. + * + * Note that even if we find an interface with the address we're looking + * for, we should skip that interface if it is not up. */ #define INADDR_TO_IA(addr, ia) \ /* struct in_addr addr; */ \ /* struct in_ifaddr *ia; */ \ { \ for (ia = IN_IFADDR_HASH((addr).s_addr).lh_first; \ - ia != NULL && !in_hosteq(ia->ia_addr.sin_addr, (addr)); \ + ia != NULL && !in_hosteq(ia->ia_addr.sin_addr, (addr)) && \ + (ia->ia_ifp->if_flags & IFF_UP) == 0; \ ia = ia->ia_hash.le_next) \ continue; \ } diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 45187ac521fe..1434822a1dde 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1,4 +1,4 @@ -/* $NetBSD: ip_input.c,v 1.85 1999/05/03 21:14:47 hwr Exp $ */ +/* $NetBSD: ip_input.c,v 1.86 1999/05/03 22:12:44 thorpej Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -428,10 +428,8 @@ next: * Check our list of addresses, to see if the packet is for us. */ INADDR_TO_IA(ip->ip_dst, ia); - if (ia != NULL) { - if (ia->ia_ifp->if_flags & IFF_UP) - goto ours; - } + if (ia != NULL) + goto ours; if (m->m_pkthdr.rcvif->if_flags & IFF_BROADCAST) { for (ifa = m->m_pkthdr.rcvif->if_addrlist.tqh_first; ifa != NULL; ifa = ifa->ifa_list.tqe_next) {