diff options
author | phk <phk@FreeBSD.org> | 2001-02-04 13:13:25 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2001-02-04 13:13:25 +0000 |
commit | e87f7a15ad62e1dd25061ddb301662e809692c2c (patch) | |
tree | 5f0ba9ebd57fbfd6e13f2b9403d96e9bfae48d8f /sys/net | |
parent | f3b4fbe35f6e8e9d09f742c114281d8e9984d135 (diff) | |
download | FreeBSD-src-e87f7a15ad62e1dd25061ddb301662e809692c2c.zip FreeBSD-src-e87f7a15ad62e1dd25061ddb301662e809692c2c.tar.gz |
Mechanical change to use <sys/queue.h> macro API instead of
fondling implementation details.
Created with: sed(1)
Reviewed by: md5(1)
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/bridge.c | 4 | ||||
-rw-r--r-- | sys/net/if.c | 12 | ||||
-rw-r--r-- | sys/net/if_ef.c | 2 | ||||
-rw-r--r-- | sys/net/if_fddisubr.c | 2 | ||||
-rw-r--r-- | sys/net/if_vlan.c | 3 | ||||
-rw-r--r-- | sys/net/pfil.c | 2 | ||||
-rw-r--r-- | sys/net/rtsock.c | 2 |
7 files changed, 13 insertions, 14 deletions
diff --git a/sys/net/bridge.c b/sys/net/bridge.c index b86ecbe..78a96ca 100644 --- a/sys/net/bridge.c +++ b/sys/net/bridge.c @@ -146,7 +146,7 @@ static void bdg_promisc_off(int clear_used) { struct ifnet *ifp ; - for (ifp = TAILQ_FIRST(&ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_link) ) { + TAILQ_FOREACH(ifp, &ifnet, if_link) { if ( (ifp2sc[ifp->if_index].flags & IFF_BDG_PROMISC) ) { int s, ret ; s = splimp(); @@ -173,7 +173,7 @@ bdg_promisc_on() struct ifnet *ifp ; int s ; - for (ifp = TAILQ_FIRST(&ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_link) ) { + TAILQ_FOREACH(ifp, &ifnet, if_link) { if ( !BDG_USED(ifp) ) continue ; if ( 0 == ( ifp->if_flags & IFF_UP) ) { diff --git a/sys/net/if.c b/sys/net/if.c index 5ca3ed7..d0be0de 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -110,7 +110,7 @@ ifinit(dummy) int s; s = splimp(); - for (ifp = TAILQ_FIRST(&ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_link)) { + TAILQ_FOREACH(ifp, &ifnet, if_link) { if (ifp->if_snd.ifq_maxlen == 0) { printf("%s%d XXX: driver didn't set ifq_maxlen\n", ifp->if_name, ifp->if_unit); @@ -357,7 +357,7 @@ ifa_ifwithaddr(addr) #define equal(a1, a2) \ (bcmp((caddr_t)(a1), (caddr_t)(a2), ((struct sockaddr *)(a1))->sa_len) == 0) - for (ifp = TAILQ_FIRST(&ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_link)) + TAILQ_FOREACH(ifp, &ifnet, if_link) for (ifa = TAILQ_FIRST(&ifp->if_addrhead); ifa; ifa = TAILQ_NEXT(ifa, ifa_link)) { if (ifa->ifa_addr->sa_family != addr->sa_family) @@ -383,7 +383,7 @@ ifa_ifwithdstaddr(addr) register struct ifnet *ifp; register struct ifaddr *ifa; - for (ifp = TAILQ_FIRST(&ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_link)) + TAILQ_FOREACH(ifp, &ifnet, if_link) if (ifp->if_flags & IFF_POINTOPOINT) for (ifa = TAILQ_FIRST(&ifp->if_addrhead); ifa; ifa = TAILQ_NEXT(ifa, ifa_link)) { @@ -423,7 +423,7 @@ ifa_ifwithnet(addr) * Scan though each interface, looking for ones that have * addresses in this address family. */ - for (ifp = TAILQ_FIRST(&ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_link)) { + TAILQ_FOREACH(ifp, &ifnet, if_link) { for (ifa = TAILQ_FIRST(&ifp->if_addrhead); ifa; ifa = TAILQ_NEXT(ifa, ifa_link)) { register char *cp, *cp2, *cp3; @@ -671,7 +671,7 @@ if_slowtimo(arg) register struct ifnet *ifp; int s = splimp(); - for (ifp = TAILQ_FIRST(&ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_link)) { + TAILQ_FOREACH(ifp, &ifnet, if_link) { if (ifp->if_timer == 0 || --ifp->if_timer) continue; if (ifp->if_watchdog) @@ -719,7 +719,7 @@ ifunit(char *name) /* * Now search all the interfaces for this name/number */ - for (ifp = TAILQ_FIRST(&ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_link)) { + TAILQ_FOREACH(ifp, &ifnet, if_link) { if (strcmp(ifp->if_name, namebuf)) continue; if (unit == ifp->if_unit) diff --git a/sys/net/if_ef.c b/sys/net/if_ef.c index 17b4a40..11d3950 100644 --- a/sys/net/if_ef.c +++ b/sys/net/if_ef.c @@ -518,7 +518,7 @@ ef_load(void) struct ef_link *efl = NULL; int error = 0, d; - for (ifp = TAILQ_FIRST(&ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_link)) { + TAILQ_FOREACH(ifp, &ifnet, if_link) { if (ifp->if_type != IFT_ETHER) continue; EFDEBUG("Found interface %s%d\n", ifp->if_name, ifp->if_unit); efl = (struct ef_link*)malloc(sizeof(struct ef_link), diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c index ccffc9b..bc7136d 100644 --- a/sys/net/if_fddisubr.c +++ b/sys/net/if_fddisubr.c @@ -537,7 +537,7 @@ fddi_ifattach(ifp) bcopy(((struct arpcom *)ifp)->ac_enaddr, LLADDR(sdl), ifp->if_addrlen); #elif defined(__NetBSD__) LIST_INIT(&((struct arpcom *)ifp)->ac_multiaddrs); - for (ifa = TAILQ_FIRST(&ifp->if_addrlist); ifa != NULL; ifa = TAILQ_NEXT(ifa, ifa_list)) + TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) #else for (ifa = ifp->if_addrlist; ifa != NULL; ifa = ifa->ifa_next) #endif diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 93f072a..2656c7cf 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -135,8 +135,7 @@ vlan_setmulti(struct ifnet *ifp) } /* Now program new ones. */ - for (ifma = LIST_FIRST(&ifp->if_multiaddrs); - ifma != NULL;ifma = LIST_NEXT(ifma, ifma_link)) { + LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; mc = malloc(sizeof(struct vlan_mc_entry), M_DEVBUF, M_NOWAIT); diff --git a/sys/net/pfil.c b/sys/net/pfil.c index d4f066c..02d9656 100644 --- a/sys/net/pfil.c +++ b/sys/net/pfil.c @@ -150,7 +150,7 @@ pfil_list_remove(list, func) { struct packet_filter_hook *pfh; - for (pfh = list->tqh_first; pfh; pfh = TAILQ_NEXT(pfh, pfil_link)) + TAILQ_FOREACH(pfh, list, pfil_link) if (pfh->pfil_func == func) { TAILQ_REMOVE(list, pfh, pfil_link); free(pfh, M_IFADDR); diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 0000c90..2dba7d9 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -893,7 +893,7 @@ sysctl_iflist(af, w) int len, error = 0; bzero((caddr_t)&info, sizeof(info)); - for (ifp = TAILQ_FIRST(&ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_link)) { + TAILQ_FOREACH(ifp, &ifnet, if_link) { if (w->w_arg && w->w_arg != ifp->if_index) continue; ifa = TAILQ_FIRST(&ifp->if_addrhead); |