From 5aa288f461f91b59b944df7946446afc5b3da386 Mon Sep 17 00:00:00 2001 From: Yaroslav Tykhiy Date: Thu, 29 Jun 2006 17:16:13 +0000 Subject: [PATCH] Use the nifty TAILQ_FOREACH. --- sys/net/if_tun.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index f3b62d017798..deee367492e1 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -393,8 +393,7 @@ tuninit(struct ifnet *ifp) ifp->if_drv_flags |= IFF_DRV_RUNNING; getmicrotime(&ifp->if_lastchange); - for (ifa = TAILQ_FIRST(&ifp->if_addrhead); ifa; - ifa = TAILQ_NEXT(ifa, ifa_link)) { + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr == NULL) error = EFAULT; /* XXX: Should maybe return straight off? */