diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c index fc8c6faa3748..b19c8553e6af 100644 --- a/sys/net/if_stf.c +++ b/sys/net/if_stf.c @@ -618,10 +618,7 @@ stf_checkaddr4(sc, in, inifp) * reject packets with broadcast */ IN_IFADDR_RLOCK(); - for (ia4 = TAILQ_FIRST(&V_in_ifaddrhead); - ia4; - ia4 = TAILQ_NEXT(ia4, ia_link)) - { + TAILQ_FOREACH(ia4, &V_in_ifaddrhead, ia_link) { if ((ia4->ia_ifa.ifa_ifp->if_flags & IFF_BROADCAST) == 0) continue; if (in->s_addr == ia4->ia_broadaddr.sin_addr.s_addr) { diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index 6fe17cd1dd14..0e8e493900b8 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -3921,8 +3921,7 @@ key_ismyaddr(sa) case AF_INET: sin = (struct sockaddr_in *)sa; IN_IFADDR_RLOCK(); - for (ia = V_in_ifaddrhead.tqh_first; ia; - ia = ia->ia_link.tqe_next) + TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { if (sin->sin_family == ia->ia_addr.sin_family && sin->sin_len == ia->ia_addr.sin_len &&