From 027c11539b96ef31a084c86c2943ccabe08f2b30 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 24 Jan 2005 21:25:09 +0000 Subject: [PATCH] Add IFNET_FOREACH and IFADDR_FOREACH macros and start using them. --- sys/compat/darwin/darwin_route.c | 10 +++++----- sys/dev/pci/if_bge.c | 6 +++--- sys/dev/qbus/if_dmc.c | 6 +++--- sys/kern/kern_subr.c | 6 +++--- sys/kern/kern_uuid.c | 8 ++++---- sys/kern/uipc_mbuf.c | 3 ++- sys/net/if.c | 6 +++--- sys/net/if.h | 8 +++++--- sys/net/if_spppsubr.c | 14 +++++++------- sys/net/if_stf.c | 6 +++--- sys/net/if_tun.c | 8 ++++---- sys/net/rtsock.c | 6 +++--- sys/netinet/in.c | 8 ++++---- sys/netinet/in_var.h | 4 ++-- sys/netinet/ip_icmp.c | 8 ++++---- sys/netinet/ip_input.c | 6 +++--- 16 files changed, 58 insertions(+), 55 deletions(-) diff --git a/sys/compat/darwin/darwin_route.c b/sys/compat/darwin/darwin_route.c index d4b8c662a48e..7a4e88a17663 100644 --- a/sys/compat/darwin/darwin_route.c +++ b/sys/compat/darwin/darwin_route.c @@ -1,4 +1,4 @@ -/* $NetBSD: darwin_route.c,v 1.8 2004/11/07 04:08:37 david Exp $ */ +/* $NetBSD: darwin_route.c,v 1.9 2005/01/24 21:25:09 matt Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: darwin_route.c,v 1.8 2004/11/07 04:08:37 david Exp $"); +__KERNEL_RCSID(0, "$NetBSD: darwin_route.c,v 1.9 2005/01/24 21:25:09 matt Exp $"); #include #include @@ -66,7 +66,7 @@ darwin_ifaddrs(af, dst, sizep) af = darwin_to_native_af[af]; - TAILQ_FOREACH(ifp, &ifnet, if_list) { + IFNET_FOREACH(ifp) { struct ifaddr *ifa; struct sockaddr_dl *laddr = NULL; struct sockaddr_storage dladdr; @@ -75,7 +75,7 @@ darwin_ifaddrs(af, dst, sizep) * Find the link layer info as it is needed * for computing darwin_if_msghdr's dim_len */ - TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) { + IFADDR_FOREACH(ifa, ifp) { if ((ifa->ifa_addr) && (ifa->ifa_addr->sa_family == AF_LINK)) { laddr = (struct sockaddr_dl *)ifa->ifa_addr; @@ -144,7 +144,7 @@ darwin_ifaddrs(af, dst, sizep) dst += ALIGN(dladdr.ss_len); } - TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) { + IFADDR_FOREACH(ifa, ifp) { struct darwin_ifa_msghdr diam; int iaf; diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index c90055483f79..5a848d9ed790 100644 --- a/sys/dev/pci/if_bge.c +++ b/sys/dev/pci/if_bge.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_bge.c,v 1.80 2005/01/08 16:00:03 fredb Exp $ */ +/* $NetBSD: if_bge.c,v 1.81 2005/01/24 21:25:09 matt Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -79,7 +79,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.80 2005/01/08 16:00:03 fredb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.81 2005/01/24 21:25:09 matt Exp $"); #include "bpfilter.h" #include "vlan.h" @@ -675,7 +675,7 @@ bge_update_all_threshes(int lvl) /* * Now search all the interfaces for this name/number */ - TAILQ_FOREACH(ifp, &ifnet, if_list) { + IFNET_FOREACH(ifp) { if (strncmp(ifp->if_xname, namebuf, namelen) != 0) continue; /* We got a match: update if doing auto-threshold-tuning */ diff --git a/sys/dev/qbus/if_dmc.c b/sys/dev/qbus/if_dmc.c index 3fd06e24db48..9b014afedbde 100644 --- a/sys/dev/qbus/if_dmc.c +++ b/sys/dev/qbus/if_dmc.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_dmc.c,v 1.7 2003/08/07 16:31:14 agc Exp $ */ +/* $NetBSD: if_dmc.c,v 1.8 2005/01/24 21:25:09 matt Exp $ */ /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_dmc.c,v 1.7 2003/08/07 16:31:14 agc Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_dmc.c,v 1.8 2005/01/24 21:25:09 matt Exp $"); #undef DMCDEBUG /* for base table dump on fatal error */ @@ -313,7 +313,7 @@ dmcinit(struct ifnet *ifp) * Check to see that an address has been set * (both local and destination for an address family). */ - TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) + IFADDR_FOREACH(ifa, ifp) if (ifa->ifa_addr->sa_family && ifa->ifa_dstaddr->sa_family) break; if (ifa == (struct ifaddr *) 0) diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c index eb612797e1d9..8111e6d4ace0 100644 --- a/sys/kern/kern_subr.c +++ b/sys/kern/kern_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_subr.c,v 1.114 2004/10/24 17:06:24 cube Exp $ */ +/* $NetBSD: kern_subr.c,v 1.115 2005/01/24 21:25:09 matt Exp $ */ /*- * Copyright (c) 1997, 1998, 1999, 2002 The NetBSD Foundation, Inc. @@ -86,7 +86,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.114 2004/10/24 17:06:24 cube Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.115 2005/01/24 21:25:09 matt Exp $"); #include "opt_ddb.h" #include "opt_md.h" @@ -821,7 +821,7 @@ setroot(bootdv, bootpartition) if (vops != NULL && vops->vfs_mountroot == mountroot && rootspec == NULL && (bootdv == NULL || bootdv->dv_class != DV_IFNET)) { - TAILQ_FOREACH(ifp, &ifnet, if_list) { + IFNET_FOREACH(ifp) { if ((ifp->if_flags & (IFF_LOOPBACK|IFF_POINTOPOINT)) == 0) break; diff --git a/sys/kern/kern_uuid.c b/sys/kern/kern_uuid.c index d446b9d145e4..93448ee53134 100644 --- a/sys/kern/kern_uuid.c +++ b/sys/kern/kern_uuid.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_uuid.c,v 1.3 2004/09/12 23:17:37 thorpej Exp $ */ +/* $NetBSD: kern_uuid.c,v 1.4 2005/01/24 21:25:09 matt Exp $ */ /* * Copyright (c) 2002 Marcel Moolenaar @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_uuid.c,v 1.3 2004/09/12 23:17:37 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_uuid.c,v 1.4 2005/01/24 21:25:09 matt Exp $"); #include #include @@ -104,9 +104,9 @@ uuid_node(uint16_t *node) int i, s; s = splnet(); - TAILQ_FOREACH(ifp, &ifnet, if_list) { + IFNET_FOREACH(ifp) { /* Walk the address list */ - TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) { + IFADDR_FOREACH(ifa, ifp) { sdl = (struct sockaddr_dl*)ifa->ifa_addr; if (sdl != NULL && sdl->sdl_family == AF_LINK && sdl->sdl_type == IFT_ETHER) { diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index c01c4326335e..d7e4726d832e 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -384,9 +384,10 @@ m_reclaim(void *arg, int flags) if (pr->pr_drain) (*pr->pr_drain)(); } - TAILQ_FOREACH(ifp, &ifnet, if_list) + IFNET_FOREACH(ifp) { if (ifp->if_drain) (*ifp->if_drain)(ifp); + } splx(s); mbstat.m_drain++; } diff --git a/sys/net/if.c b/sys/net/if.c index ea0bb72f12be..5166e220e132 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $NetBSD: if.c,v 1.152 2005/01/23 18:41:56 matt Exp $ */ +/* $NetBSD: if.c,v 1.153 2005/01/24 21:25:09 matt Exp $ */ /*- * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.152 2005/01/23 18:41:56 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.153 2005/01/24 21:25:09 matt Exp $"); #include "opt_inet.h" @@ -1662,7 +1662,7 @@ ifconf(cmd, data) } else { sign = 1; } - TAILQ_FOREACH(ifp, &ifnet, if_list) { + IFNET_FOREACH(ifp) { bcopy(ifp->if_xname, ifr.ifr_name, IFNAMSIZ); if ((ifa = TAILQ_FIRST(&ifp->if_addrlist)) == 0) { memset(&ifr.ifr_addr, 0, sizeof(ifr.ifr_addr)); diff --git a/sys/net/if.h b/sys/net/if.h index fcbdde8c932e..e0b21e9065af 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -1,4 +1,4 @@ -/* $NetBSD: if.h,v 1.99 2005/01/08 03:18:18 yamt Exp $ */ +/* $NetBSD: if.h,v 1.100 2005/01/24 21:25:09 matt Exp $ */ /*- * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -725,11 +725,13 @@ do { \ #define IFQ_INC_DROPS(ifq) ((ifq)->ifq_drops++) #define IFQ_SET_MAXLEN(ifq, len) ((ifq)->ifq_maxlen = (len)) -#ifdef _KERNEL #include MALLOC_DECLARE(M_IFADDR); MALLOC_DECLARE(M_IFMADDR); -#endif + +#define IFNET_FOREACH(ifp) TAILQ_FOREACH(ifp, &ifnet, if_list) +#define IFADDR_FOREACH(ifa, ifp) TAILQ_FOREACH(ifa, \ + &(ifp)->if_addrlist, ifa_list) extern struct ifnet_head ifnet; extern struct ifnet **ifindex2ifnet; diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index f185a1c14bdd..16bc69e7ec50 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_spppsubr.c,v 1.80 2004/12/22 05:11:24 itojun Exp $ */ +/* $NetBSD: if_spppsubr.c,v 1.81 2005/01/24 21:25:09 matt Exp $ */ /* * Synchronous PPP/Cisco link level subroutines. @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.80 2004/12/22 05:11:24 itojun Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.81 2005/01/24 21:25:09 matt Exp $"); #include "opt_inet.h" #include "opt_ipx.h" @@ -4749,7 +4749,7 @@ sppp_get_ip_addrs(struct sppp *sp, u_int32_t *src, u_int32_t *dst, u_int32_t *sr * aliases don't make any sense on a p2p link anyway. */ si = 0; - TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) { + IFADDR_FOREACH(ifa, ifp) { if (ifa->ifa_addr->sa_family == AF_INET) { si = (struct sockaddr_in *)ifa->ifa_addr; sm = (struct sockaddr_in *)ifa->ifa_netmask; @@ -4789,7 +4789,7 @@ sppp_set_ip_addrs(struct sppp *sp, u_int32_t myaddr, u_int32_t hisaddr) * aliases don't make any sense on a p2p link anyway. */ - TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) { + IFADDR_FOREACH(ifa, ifp) { if (ifa->ifa_addr->sa_family == AF_INET) { si = (struct sockaddr_in *)ifa->ifa_addr; dest = (struct sockaddr_in *)ifa->ifa_dstaddr; @@ -4855,7 +4855,7 @@ sppp_clear_ip_addrs(struct sppp *sp) * aliases don't make any sense on a p2p link anyway. */ - TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) { + IFADDR_FOREACH(ifa, ifp) { if (ifa->ifa_addr->sa_family == AF_INET) { si = (struct sockaddr_in *)ifa->ifa_addr; dest = (struct sockaddr_in *)ifa->ifa_dstaddr; @@ -4904,7 +4904,7 @@ sppp_get_ip6_addrs(struct sppp *sp, struct in6_addr *src, struct in6_addr *dst, * aliases don't make any sense on a p2p link anyway. */ si = 0; - TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) + IFADDR_FOREACH(ifa, ifp) if (ifa->ifa_addr->sa_family == AF_INET6) { si = (struct sockaddr_in6 *)ifa->ifa_addr; sm = (struct sockaddr_in6 *)ifa->ifa_netmask; @@ -4957,7 +4957,7 @@ sppp_set_ip6_addr(struct sppp *sp, const struct in6_addr *src) */ sin6 = NULL; - TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) + IFADDR_FOREACH(ifa, ifp) { if (ifa->ifa_addr->sa_family == AF_INET6) { diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c index 107e96652c79..a175c5ab8c11 100644 --- a/sys/net/if_stf.c +++ b/sys/net/if_stf.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_stf.c,v 1.41 2004/12/04 18:31:43 peter Exp $ */ +/* $NetBSD: if_stf.c,v 1.42 2005/01/24 21:25:09 matt Exp $ */ /* $KAME: if_stf.c,v 1.62 2001/06/07 22:32:16 itojun Exp $ */ /* @@ -75,7 +75,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_stf.c,v 1.41 2004/12/04 18:31:43 peter Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_stf.c,v 1.42 2005/01/24 21:25:09 matt Exp $"); #include "opt_inet.h" @@ -316,7 +316,7 @@ stf_getsrcifa6(ifp) struct sockaddr_in6 *sin6; struct in_addr in; - TAILQ_FOREACH(ia, &ifp->if_addrlist, ifa_list) + IFADDR_FOREACH(ifa, ifp) { if (ia->ifa_addr == NULL) continue; diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 5fdf0f1f15f7..acf0b4a5da32 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_tun.c,v 1.75 2004/12/06 02:59:23 christos Exp $ */ +/* $NetBSD: if_tun.c,v 1.76 2005/01/24 21:25:09 matt Exp $ */ /* * Copyright (c) 1988, Julian Onions @@ -15,7 +15,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.75 2004/12/06 02:59:23 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.76 2005/01/24 21:25:09 matt Exp $"); #include "opt_inet.h" #include "opt_ns.h" @@ -356,7 +356,7 @@ tunclose(dev, flag, mode, p) if (ifp->if_flags & IFF_RUNNING) { /* find internet addresses and delete routes */ struct ifaddr *ifa; - TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) { + IFADDR_FOREACH(ifa, ifp) { #ifdef INET if (ifa->ifa_addr->sa_family == AF_INET) { rtinit(ifa, (int)RTM_DELETE, @@ -393,7 +393,7 @@ tuninit(tp) ifp->if_flags |= IFF_UP | IFF_RUNNING; tp->tun_flags &= ~(TUN_IASET|TUN_DSTADDR); - TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) { + IFADDR_FOREACH(ifa, ifp) { #ifdef INET if (ifa->ifa_addr->sa_family == AF_INET) { struct sockaddr_in *sin; diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 69b19c5f627d..08c63c0cad3e 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -1,4 +1,4 @@ -/* $NetBSD: rtsock.c,v 1.73 2005/01/23 18:41:57 matt Exp $ */ +/* $NetBSD: rtsock.c,v 1.74 2005/01/24 21:25:09 matt Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.73 2005/01/23 18:41:57 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.74 2005/01/24 21:25:09 matt Exp $"); #include "opt_inet.h" @@ -896,7 +896,7 @@ sysctl_iflist(int af, struct walkarg *w, int type) int len, error = 0; memset(&info, 0, sizeof(info)); - TAILQ_FOREACH(ifp, &ifnet, if_list) { + IFNET_FOREACH(ifp) { if (w->w_arg && w->w_arg != ifp->if_index) continue; ifa = TAILQ_FIRST(&ifp->if_addrlist); diff --git a/sys/netinet/in.c b/sys/netinet/in.c index af3f3a5f20a1..5e987d501549 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1,4 +1,4 @@ -/* $NetBSD: in.c,v 1.100 2004/08/08 09:52:41 yamt Exp $ */ +/* $NetBSD: in.c,v 1.101 2005/01/24 21:25:09 matt Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -98,7 +98,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.100 2004/08/08 09:52:41 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.101 2005/01/24 21:25:09 matt Exp $"); #include "opt_inet.h" #include "opt_inet_conf.h" @@ -736,7 +736,7 @@ in_lifaddr_ioctl(so, cmd, data, ifp, p) } } - TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) { + IFADDR_FOREACH(ifa, ifp) { if (ifa->ifa_addr->sa_family != AF_INET) continue; if (!cmp) @@ -1042,7 +1042,7 @@ in_broadcast(in, ifp) * with a broadcast address. */ #define ia (ifatoia(ifa)) - TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) + IFADDR_FOREACH(ifa, ifp) if (ifa->ifa_addr->sa_family == AF_INET && !in_hosteq(in, ia->ia_addr.sin_addr) && (in_hosteq(in, ia->ia_broadaddr.sin_addr) || diff --git a/sys/netinet/in_var.h b/sys/netinet/in_var.h index aa381bbfe305..5a01e21a82d2 100644 --- a/sys/netinet/in_var.h +++ b/sys/netinet/in_var.h @@ -1,4 +1,4 @@ -/* $NetBSD: in_var.h,v 1.53 2004/04/21 17:49:46 itojun Exp $ */ +/* $NetBSD: in_var.h,v 1.54 2005/01/24 21:25:09 matt Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -204,7 +204,7 @@ extern const int inetctlerrmap[]; { \ struct ifaddr *ifa; \ \ - TAILQ_FOREACH(ifa, &(ifp)->if_addrlist, ifa_list) { \ + IFADDR_FOREACH(ifa, ifp) { \ if (ifa->ifa_addr->sa_family == AF_INET) \ break; \ } \ diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 3a4b1a496c9d..eac6be9c5263 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -1,4 +1,4 @@ -/* $NetBSD: ip_icmp.c,v 1.87 2004/08/03 13:58:59 cube Exp $ */ +/* $NetBSD: ip_icmp.c,v 1.88 2005/01/24 21:25:09 matt Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -101,7 +101,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.87 2004/08/03 13:58:59 cube Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.88 2005/01/24 21:25:09 matt Exp $"); #include "opt_ipsec.h" @@ -669,7 +669,7 @@ icmp_reflect(m) /* look for packet sent to broadcast address */ if (ia == NULL && m->m_pkthdr.rcvif && (m->m_pkthdr.rcvif->if_flags & IFF_BROADCAST)) { - TAILQ_FOREACH(ifa, &m->m_pkthdr.rcvif->if_addrlist, ifa_list) { + IFADDR_FOREACH(ifa, m->m_pkthdr.rcvif) { if (ifa->ifa_addr->sa_family != AF_INET) continue; if (in_hosteq(t,ifatoia(ifa)->ia_broadaddr.sin_addr)) { @@ -726,7 +726,7 @@ icmp_reflect(m) * when the incoming packet was encapsulated */ if (sin == (struct sockaddr_in *)0 && m->m_pkthdr.rcvif) { - TAILQ_FOREACH(ifa, &m->m_pkthdr.rcvif->if_addrlist, ifa_list) { + IFADDR_FOREACH(ifa, m->m_pkthdr.rcvif) { if (ifa->ifa_addr->sa_family != AF_INET) continue; sin = &(ifatoia(ifa)->ia_addr); diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index d8f43ce9f663..f3e0d5f54c9f 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1,4 +1,4 @@ -/* $NetBSD: ip_input.c,v 1.208 2004/12/19 06:42:24 christos Exp $ */ +/* $NetBSD: ip_input.c,v 1.209 2005/01/24 21:25:10 matt Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -98,7 +98,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.208 2004/12/19 06:42:24 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.209 2005/01/24 21:25:10 matt Exp $"); #include "opt_inet.h" #include "opt_gateway.h" @@ -733,7 +733,7 @@ ip_input(struct mbuf *m) if (ia != NULL) goto ours; if (m->m_pkthdr.rcvif->if_flags & IFF_BROADCAST) { - TAILQ_FOREACH(ifa, &m->m_pkthdr.rcvif->if_addrlist, ifa_list) { + IFADDR_FOREACH(ifa, m->m_pkthdr.rcvif) { if (ifa->ifa_addr->sa_family != AF_INET) continue; ia = ifatoia(ifa);