diff options
author | phk <phk@FreeBSD.org> | 2001-02-06 10:12:15 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2001-02-06 10:12:15 +0000 |
commit | d214ae21714540c7d954bd861ed084fb157abeb9 (patch) | |
tree | 7c665d67872a65310572d737c33defbe1a63008e /sys/net | |
parent | 43450ced687857ec4a35796cfed2820c891c103d (diff) | |
download | FreeBSD-src-d214ae21714540c7d954bd861ed084fb157abeb9.zip FreeBSD-src-d214ae21714540c7d954bd861ed084fb157abeb9.tar.gz |
Convert if_multiaddrs from LIST to TAILQ so that it can be traversed
backwards in the three drivers which want to do that.
Reviewed by: mikeh
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if.c | 20 | ||||
-rw-r--r-- | sys/net/if_var.h | 4 | ||||
-rw-r--r-- | sys/net/if_vlan.c | 2 |
3 files changed, 13 insertions, 13 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index c1a4bd3..dc434f3 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -164,7 +164,7 @@ if_attach(ifp) */ TAILQ_INIT(&ifp->if_addrhead); TAILQ_INIT(&ifp->if_prefixhead); - LIST_INIT(&ifp->if_multiaddrs); + TAILQ_INIT(&ifp->if_multiaddrs); getmicrotime(&ifp->if_lastchange); if (ifnet_addrs == 0 || if_index >= if_indexlim) { unsigned n = (if_indexlim <<= 1) * sizeof(ifa); @@ -1182,7 +1182,7 @@ if_addmulti(ifp, sa, retifma) * If the matching multicast address already exists * then don't add a new one, just add a reference */ - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (equal(sa, ifma->ifma_addr)) { ifma->ifma_refcount++; if (retifma) @@ -1219,12 +1219,12 @@ if_addmulti(ifp, sa, retifma) * interrupt time; lock them out. */ s = splimp(); - LIST_INSERT_HEAD(&ifp->if_multiaddrs, ifma, ifma_link); + TAILQ_INSERT_HEAD(&ifp->if_multiaddrs, ifma, ifma_link); splx(s); *retifma = ifma; if (llsa != 0) { - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (equal(ifma->ifma_addr, llsa)) break; } @@ -1240,7 +1240,7 @@ if_addmulti(ifp, sa, retifma) ifma->ifma_ifp = ifp; ifma->ifma_refcount = 1; s = splimp(); - LIST_INSERT_HEAD(&ifp->if_multiaddrs, ifma, ifma_link); + TAILQ_INSERT_HEAD(&ifp->if_multiaddrs, ifma, ifma_link); splx(s); } } @@ -1267,7 +1267,7 @@ if_delmulti(ifp, sa) struct ifmultiaddr *ifma; int s; - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) if (equal(sa, ifma->ifma_addr)) break; if (ifma == 0) @@ -1281,7 +1281,7 @@ if_delmulti(ifp, sa) rt_newmaddrmsg(RTM_DELMADDR, ifma); sa = ifma->ifma_lladdr; s = splimp(); - LIST_REMOVE(ifma, ifma_link); + TAILQ_REMOVE(&ifp->if_multiaddrs, ifma, ifma_link); splx(s); free(ifma->ifma_addr, M_IFMADDR); free(ifma, M_IFMADDR); @@ -1299,7 +1299,7 @@ if_delmulti(ifp, sa) * in the record for the link-layer address. (So we don't complain * in that case.) */ - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) if (equal(sa, ifma->ifma_addr)) break; if (ifma == 0) @@ -1311,7 +1311,7 @@ if_delmulti(ifp, sa) } s = splimp(); - LIST_REMOVE(ifma, ifma_link); + TAILQ_REMOVE(&ifp->if_multiaddrs, ifma, ifma_link); ifp->if_ioctl(ifp, SIOCDELMULTI, 0); splx(s); free(ifma->ifma_addr, M_IFMADDR); @@ -1374,7 +1374,7 @@ ifmaof_ifpforaddr(sa, ifp) { struct ifmultiaddr *ifma; - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) if (equal(ifma->ifma_addr, sa)) break; diff --git a/sys/net/if_var.h b/sys/net/if_var.h index fc60f9c..68b0c01 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -83,7 +83,7 @@ struct ether_header; TAILQ_HEAD(ifnethead, ifnet); /* we use TAILQs so that the order of */ TAILQ_HEAD(ifaddrhead, ifaddr); /* instantiation is preserved in the list */ TAILQ_HEAD(ifprefixhead, ifprefix); -LIST_HEAD(ifmultihead, ifmultiaddr); +TAILQ_HEAD(ifmultihead, ifmultiaddr); /* * Structure defining a queue for a network interface. @@ -352,7 +352,7 @@ struct ifprefix { * address, not a count of pointers to this structure. */ struct ifmultiaddr { - LIST_ENTRY(ifmultiaddr) ifma_link; /* queue macro glue */ + TAILQ_ENTRY(ifmultiaddr) ifma_link; /* queue macro glue */ struct sockaddr *ifma_addr; /* address this membership is for */ struct sockaddr *ifma_lladdr; /* link-layer translation, if any */ struct ifnet *ifma_ifp; /* back-pointer to interface */ diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 2656c7cf..aa7ced1 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -135,7 +135,7 @@ vlan_setmulti(struct ifnet *ifp) } /* Now program new ones. */ - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + TAILQ_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); |