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
This commit is contained in:
parent
2cdd9c0332
commit
6817526d14
@ -791,7 +791,7 @@ awi_init(sc)
|
||||
#ifdef __FreeBSD__
|
||||
if (ifp->if_amcount != 0)
|
||||
goto set_mib;
|
||||
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;
|
||||
if (n == AWI_GROUP_ADDR_SIZE)
|
||||
|
@ -1051,7 +1051,7 @@ void dc_setfilt_21143(sc)
|
||||
else
|
||||
DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI);
|
||||
|
||||
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;
|
||||
h = dc_crc_le(sc,
|
||||
@ -1122,7 +1122,7 @@ void dc_setfilt_admtek(sc)
|
||||
return;
|
||||
|
||||
/* 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;
|
||||
h = dc_crc_be(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
|
||||
@ -1190,7 +1190,7 @@ void dc_setfilt_asix(sc)
|
||||
return;
|
||||
|
||||
/* 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;
|
||||
h = dc_crc_be(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
|
||||
@ -1244,7 +1244,7 @@ void dc_setfilt_xircom(sc)
|
||||
else
|
||||
DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI);
|
||||
|
||||
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;
|
||||
h = dc_crc_le(sc,
|
||||
|
@ -3012,7 +3012,7 @@ tulip_addr_filter(
|
||||
#endif
|
||||
|
||||
multicnt = 0;
|
||||
LIST_FOREACH(ifma, &sc->tulip_if.if_multiaddrs, ifma_link) {
|
||||
TAILQ_FOREACH(ifma, &sc->tulip_if.if_multiaddrs, ifma_link) {
|
||||
|
||||
if (ifma->ifma_addr->sa_family == AF_LINK)
|
||||
multicnt++;
|
||||
@ -3040,7 +3040,7 @@ tulip_addr_filter(
|
||||
*/
|
||||
bzero(sc->tulip_setupdata, sizeof(sc->tulip_setupdata));
|
||||
|
||||
LIST_FOREACH(ifma, &sc->tulip_if.if_multiaddrs, ifma_link) {
|
||||
TAILQ_FOREACH(ifma, &sc->tulip_if.if_multiaddrs, ifma_link) {
|
||||
|
||||
if (ifma->ifma_addr->sa_family != AF_LINK)
|
||||
continue;
|
||||
@ -3090,7 +3090,7 @@ tulip_addr_filter(
|
||||
/*
|
||||
* Else can get perfect filtering for 16 addresses.
|
||||
*/
|
||||
LIST_FOREACH(ifma, &sc->tulip_if.if_multiaddrs, ifma_link) {
|
||||
TAILQ_FOREACH(ifma, &sc->tulip_if.if_multiaddrs, ifma_link) {
|
||||
if (ifma->ifma_addr->sa_family != AF_LINK)
|
||||
continue;
|
||||
addrp = LLADDR((struct sockaddr_dl *)ifma->ifma_addr);
|
||||
|
@ -3286,7 +3286,7 @@ ds_getmcaf(sc, mcaf)
|
||||
mcaf[0] = 0;
|
||||
mcaf[1] = 0;
|
||||
|
||||
LIST_FOREACH(ifma, &sc->arpcom.ac_if.if_multiaddrs, ifma_link) {
|
||||
TAILQ_FOREACH(ifma, &sc->arpcom.ac_if.if_multiaddrs, ifma_link) {
|
||||
if (ifma->ifma_addr->sa_family != AF_LINK)
|
||||
continue;
|
||||
index = ds_crc(LLADDR((struct sockaddr_dl *)ifma->ifma_addr))
|
||||
|
@ -2120,7 +2120,7 @@ fe_mcaf ( struct fe_softc *sc )
|
||||
struct ifmultiaddr *ifma;
|
||||
|
||||
filter = fe_filter_nothing;
|
||||
LIST_FOREACH(ifma, &sc->arpcom.ac_if.if_multiaddrs, ifma_link) {
|
||||
TAILQ_FOREACH(ifma, &sc->arpcom.ac_if.if_multiaddrs, ifma_link) {
|
||||
if (ifma->ifma_addr->sa_family != AF_LINK)
|
||||
continue;
|
||||
index = fe_hash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
|
||||
|
@ -1907,7 +1907,7 @@ fxp_mc_setup(sc)
|
||||
|
||||
nmcasts = 0;
|
||||
if (!sc->all_mcasts) {
|
||||
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;
|
||||
if (nmcasts >= MAXMCADDR) {
|
||||
|
@ -2150,7 +2150,7 @@ ie_mc_reset(int unit)
|
||||
* Step through the list of addresses.
|
||||
*/
|
||||
ie->mcast_count = 0;
|
||||
LIST_FOREACH(ifma, &ie->arpcom.ac_if.if_multiaddrs, ifma_link) {
|
||||
TAILQ_FOREACH(ifma, &ie->arpcom.ac_if.if_multiaddrs, ifma_link) {
|
||||
if (ifma->ifma_addr->sa_family != AF_LINK)
|
||||
continue;
|
||||
|
||||
|
@ -245,7 +245,7 @@ lnc_setladrf(struct lnc_softc *sc)
|
||||
*/
|
||||
|
||||
bzero(sc->init_block->ladrf, MULTICAST_FILTER_LEN);
|
||||
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;
|
||||
|
||||
|
@ -227,8 +227,8 @@ pdq_os_addr_fill(
|
||||
pdq_softc_t *sc = (pdq_softc_t *) pdq->pdq_os_ctx;
|
||||
struct ifmultiaddr *ifma;
|
||||
|
||||
for (ifma = LIST_FIRST(&sc->sc_if.if_multiaddrs); ifma && num_addrs > 0;
|
||||
ifma = LIST_NEXT(ifma, ifma_link)) {
|
||||
for (ifma = TAILQ_FIRST(&sc->sc_if.if_multiaddrs); ifma && num_addrs > 0;
|
||||
ifma = TAILQ_NEXT(ifma, ifma_link)) {
|
||||
char *mcaddr;
|
||||
if (ifma->ifma_addr->sa_family != AF_LINK)
|
||||
continue;
|
||||
|
@ -2420,7 +2420,7 @@ ray_mcast(struct ray_softc *sc, struct ray_comq_entry *com)
|
||||
* The multicast list is only 16 items long so use promiscuous
|
||||
* mode and don't bother updating the multicast list.
|
||||
*/
|
||||
LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
|
||||
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
|
||||
if (count == 0) {
|
||||
ray_com_runq_done(sc);
|
||||
return;
|
||||
@ -2438,7 +2438,7 @@ ray_mcast(struct ray_softc *sc, struct ray_comq_entry *com)
|
||||
SRAM_WRITE_FIELD_1(sc, com->c_ccs,
|
||||
ray_cmd_update_mcast, c_nmcast, count);
|
||||
bufp = RAY_HOST_TO_ECF_BASE;
|
||||
LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
|
||||
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
|
||||
SRAM_WRITE_REGION(
|
||||
sc,
|
||||
bufp,
|
||||
|
@ -448,14 +448,7 @@ static void sf_setmulti(sc)
|
||||
SF_SETBIT(sc, SF_RXFILT, SF_RXFILT_ALLMULTI);
|
||||
} else {
|
||||
i = 1;
|
||||
/* First find the tail of the list. */
|
||||
LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
|
||||
if (LIST_NEXT(ifma, ifma_link) == NULL)
|
||||
break;
|
||||
}
|
||||
/* Now traverse the list backwards. */
|
||||
for (; ifma != NULL && ifma != (void *)&ifp->if_multiaddrs;
|
||||
ifma = (struct ifmultiaddr *)ifma->ifma_link.le_prev) {
|
||||
TAILQ_FOREACH_REVERSE(ifma, &ifp->if_multiaddrs, ifmultihead, ifma_link) {
|
||||
if (ifma->ifma_addr->sa_family != AF_LINK)
|
||||
continue;
|
||||
/*
|
||||
|
@ -557,14 +557,7 @@ static void sk_setmulti(sc_if)
|
||||
hashes[1] = 0xFFFFFFFF;
|
||||
} else {
|
||||
i = 1;
|
||||
/* First find the tail of the list. */
|
||||
LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
|
||||
if (LIST_NEXT(ifma, ifma_link) == NULL)
|
||||
break;
|
||||
}
|
||||
/* Now traverse the list backwards. */
|
||||
for (; ifma != NULL && ifma != (void *)&ifp->if_multiaddrs;
|
||||
ifma = (struct ifmultiaddr *)ifma->ifma_link.le_prev) {
|
||||
TAILQ_FOREACH_REVERSE(ifma, &ifp->if_multiaddrs, ifmultihead, ifma_link) {
|
||||
if (ifma->ifma_addr->sa_family != AF_LINK)
|
||||
continue;
|
||||
/*
|
||||
|
@ -1461,7 +1461,7 @@ sn_getmcf(struct arpcom *ac, u_char *mcf)
|
||||
|
||||
bzero(mcf, MCFSZ);
|
||||
|
||||
LIST_FOREACH(ifma, &ac->ac_if.if_multiaddrs, ifma_link) {
|
||||
TAILQ_FOREACH(ifma, &ac->ac_if.if_multiaddrs, ifma_link) {
|
||||
if (ifma->ifma_addr->sa_family != AF_LINK)
|
||||
return 0;
|
||||
index = smc_crc(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)) & 0x3f;
|
||||
|
@ -678,7 +678,7 @@ camprogram(sc)
|
||||
ifp->if_flags &= ~IFF_ALLMULTI;
|
||||
|
||||
/* Loop through multicast addresses */
|
||||
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;
|
||||
if (mcount == MAXCAM) {
|
||||
|
@ -1081,7 +1081,7 @@ static void ti_setmulti(sc)
|
||||
}
|
||||
|
||||
/* 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 ti_mc_entry), M_DEVBUF, M_NOWAIT);
|
||||
|
@ -538,7 +538,7 @@ Static void aue_setmulti(sc)
|
||||
csr_write_1(sc, AUE_MAR0 + i, 0);
|
||||
|
||||
/* 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;
|
||||
h = aue_crc(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
|
||||
|
@ -382,7 +382,7 @@ Static void cue_setmulti(sc)
|
||||
sc->cue_mctab[i] = 0;
|
||||
|
||||
/* 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;
|
||||
h = cue_crc(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
|
||||
|
@ -336,7 +336,7 @@ Static void kue_setmulti(sc)
|
||||
|
||||
sc->kue_rxfilt &= ~KUE_RXFILT_ALLMULTI;
|
||||
|
||||
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;
|
||||
/*
|
||||
|
@ -530,7 +530,7 @@ static void vr_setmulti(sc)
|
||||
CSR_WRITE_4(sc, VR_MAR1, 0);
|
||||
|
||||
/* 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;
|
||||
h = vr_calchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
|
||||
|
@ -1035,7 +1035,7 @@ static void wi_setmulti(sc)
|
||||
return;
|
||||
}
|
||||
|
||||
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;
|
||||
if (i < 16) {
|
||||
|
@ -2060,7 +2060,7 @@ wlconfig(int unit)
|
||||
outw(PIOP1(base), AC_MCSETUP|AC_CW_EL); /* ac_command */
|
||||
outw(PIOR1(base), OFFSET_CU + 8);
|
||||
#if defined(__FreeBSD__) && __FreeBSD_version >= 300000
|
||||
LIST_FOREACH(ifma, &sc->wl_if.if_multiaddrs, ifma_link) {
|
||||
TAILQ_FOREACH(ifma, &sc->wl_if.if_multiaddrs, ifma_link) {
|
||||
if (ifma->ifma_addr->sa_family != AF_LINK)
|
||||
continue;
|
||||
|
||||
|
@ -1590,10 +1590,10 @@ xe_setmulti(struct xe_softc *scp) {
|
||||
int count;
|
||||
|
||||
ifp = &scp->arpcom.ac_if;
|
||||
maddr = LIST_FIRST(&ifp->if_multiaddrs);
|
||||
maddr = TAILQ_FIRST(&ifp->if_multiaddrs);
|
||||
|
||||
/* Get length of multicast list */
|
||||
for (count = 0; maddr != NULL; maddr = LIST_NEXT(maddr, ifma_link), count++);
|
||||
for (count = 0; maddr != NULL; maddr = TAILQ_NEXT(maddr, ifma_link), count++);
|
||||
|
||||
if ((ifp->if_flags & IFF_PROMISC) || (ifp->if_flags & IFF_ALLMULTI) || (count > 9)) {
|
||||
/*
|
||||
@ -1643,7 +1643,7 @@ xe_setaddrs(struct xe_softc *scp) {
|
||||
u_int8_t *addr;
|
||||
u_int8_t page, slot, byte, i;
|
||||
|
||||
maddr = LIST_FIRST(&scp->arpcom.ac_if.if_multiaddrs);
|
||||
maddr = TAILQ_FIRST(&scp->arpcom.ac_if.if_multiaddrs);
|
||||
|
||||
XE_SELECT_PAGE(page = 0x50);
|
||||
|
||||
@ -1653,7 +1653,7 @@ xe_setaddrs(struct xe_softc *scp) {
|
||||
addr = (u_int8_t *)(&scp->arpcom.ac_enaddr);
|
||||
else {
|
||||
while (maddr != NULL && maddr->ifma_addr->sa_family != AF_LINK)
|
||||
maddr = LIST_NEXT(maddr, ifma_link);
|
||||
maddr = TAILQ_NEXT(maddr, ifma_link);
|
||||
if (maddr != NULL)
|
||||
addr = LLADDR((struct sockaddr_dl *)maddr->ifma_addr);
|
||||
else
|
||||
|
@ -560,7 +560,7 @@ le_multi_filter(
|
||||
|
||||
sc->le_flags |= IFF_MULTICAST;
|
||||
|
||||
LIST_FOREACH(ifma, &sc->le_ac.ac_if.if_multiaddrs, ifma_link) {
|
||||
TAILQ_FOREACH(ifma, &sc->le_ac.ac_if.if_multiaddrs, ifma_link) {
|
||||
if (ifma->ifma_addr->sa_family != AF_LINK)
|
||||
continue;
|
||||
|
||||
|
@ -2060,7 +2060,7 @@ wlconfig(int unit)
|
||||
outw(PIOP1(base), AC_MCSETUP|AC_CW_EL); /* ac_command */
|
||||
outw(PIOR1(base), OFFSET_CU + 8);
|
||||
#if defined(__FreeBSD__) && __FreeBSD_version >= 300000
|
||||
LIST_FOREACH(ifma, &sc->wl_if.if_multiaddrs, ifma_link) {
|
||||
TAILQ_FOREACH(ifma, &sc->wl_if.if_multiaddrs, ifma_link) {
|
||||
if (ifma->ifma_addr->sa_family != AF_LINK)
|
||||
continue;
|
||||
|
||||
|
20
sys/net/if.c
20
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;
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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);
|
||||
|
@ -182,7 +182,7 @@ struct in_multistep {
|
||||
do { \
|
||||
register struct ifmultiaddr *ifma; \
|
||||
\
|
||||
LIST_FOREACH(ifma, &((ifp)->if_multiaddrs), ifma_link) { \
|
||||
TAILQ_FOREACH(ifma, &((ifp)->if_multiaddrs), ifma_link) { \
|
||||
if (ifma->ifma_addr->sa_family == AF_INET \
|
||||
&& ((struct sockaddr_in *)ifma->ifma_addr)->sin_addr.s_addr == \
|
||||
(addr).s_addr) \
|
||||
|
@ -517,8 +517,7 @@ struct in6_multistep {
|
||||
/* struct in6_multi *in6m; */ \
|
||||
do { \
|
||||
register struct ifmultiaddr *ifma; \
|
||||
for (ifma = (ifp)->if_multiaddrs.lh_first; ifma; \
|
||||
ifma = ifma->ifma_link.le_next) { \
|
||||
TAILQ_FOREACH(ifma, &(ifp)->if_multiaddrs, ifma_link) { \
|
||||
if (ifma->ifma_addr->sa_family == AF_INET6 \
|
||||
&& IN6_ARE_ADDR_EQUAL(&((struct sockaddr_in6 *)ifma->ifma_addr)->sin6_addr, \
|
||||
&(addr))) \
|
||||
|
@ -266,7 +266,7 @@ mld6_input(m, off)
|
||||
mld6_all_nodes_linklocal.s6_addr16[1] =
|
||||
htons(ifp->if_index); /* XXX */
|
||||
|
||||
LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
|
||||
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
|
||||
{
|
||||
if (ifma->ifma_addr->sa_family != AF_INET6)
|
||||
continue;
|
||||
|
@ -1051,7 +1051,7 @@ void dc_setfilt_21143(sc)
|
||||
else
|
||||
DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI);
|
||||
|
||||
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;
|
||||
h = dc_crc_le(sc,
|
||||
@ -1122,7 +1122,7 @@ void dc_setfilt_admtek(sc)
|
||||
return;
|
||||
|
||||
/* 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;
|
||||
h = dc_crc_be(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
|
||||
@ -1190,7 +1190,7 @@ void dc_setfilt_asix(sc)
|
||||
return;
|
||||
|
||||
/* 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;
|
||||
h = dc_crc_be(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
|
||||
@ -1244,7 +1244,7 @@ void dc_setfilt_xircom(sc)
|
||||
else
|
||||
DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI);
|
||||
|
||||
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;
|
||||
h = dc_crc_le(sc,
|
||||
|
@ -3012,7 +3012,7 @@ tulip_addr_filter(
|
||||
#endif
|
||||
|
||||
multicnt = 0;
|
||||
LIST_FOREACH(ifma, &sc->tulip_if.if_multiaddrs, ifma_link) {
|
||||
TAILQ_FOREACH(ifma, &sc->tulip_if.if_multiaddrs, ifma_link) {
|
||||
|
||||
if (ifma->ifma_addr->sa_family == AF_LINK)
|
||||
multicnt++;
|
||||
@ -3040,7 +3040,7 @@ tulip_addr_filter(
|
||||
*/
|
||||
bzero(sc->tulip_setupdata, sizeof(sc->tulip_setupdata));
|
||||
|
||||
LIST_FOREACH(ifma, &sc->tulip_if.if_multiaddrs, ifma_link) {
|
||||
TAILQ_FOREACH(ifma, &sc->tulip_if.if_multiaddrs, ifma_link) {
|
||||
|
||||
if (ifma->ifma_addr->sa_family != AF_LINK)
|
||||
continue;
|
||||
@ -3090,7 +3090,7 @@ tulip_addr_filter(
|
||||
/*
|
||||
* Else can get perfect filtering for 16 addresses.
|
||||
*/
|
||||
LIST_FOREACH(ifma, &sc->tulip_if.if_multiaddrs, ifma_link) {
|
||||
TAILQ_FOREACH(ifma, &sc->tulip_if.if_multiaddrs, ifma_link) {
|
||||
if (ifma->ifma_addr->sa_family != AF_LINK)
|
||||
continue;
|
||||
addrp = LLADDR((struct sockaddr_dl *)ifma->ifma_addr);
|
||||
|
@ -1907,7 +1907,7 @@ fxp_mc_setup(sc)
|
||||
|
||||
nmcasts = 0;
|
||||
if (!sc->all_mcasts) {
|
||||
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;
|
||||
if (nmcasts >= MAXMCADDR) {
|
||||
|
@ -343,7 +343,7 @@ static void pcn_setmulti(sc)
|
||||
pcn_csr_write(sc, PCN_CSR_MAR0 + i, 0);
|
||||
|
||||
/* 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;
|
||||
h = pcn_crc(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
|
||||
|
@ -719,7 +719,7 @@ static void rl_setmulti(sc)
|
||||
CSR_WRITE_4(sc, RL_MAR4, 0);
|
||||
|
||||
/* 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;
|
||||
h = rl_calchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
|
||||
|
@ -448,14 +448,7 @@ static void sf_setmulti(sc)
|
||||
SF_SETBIT(sc, SF_RXFILT, SF_RXFILT_ALLMULTI);
|
||||
} else {
|
||||
i = 1;
|
||||
/* First find the tail of the list. */
|
||||
LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
|
||||
if (LIST_NEXT(ifma, ifma_link) == NULL)
|
||||
break;
|
||||
}
|
||||
/* Now traverse the list backwards. */
|
||||
for (; ifma != NULL && ifma != (void *)&ifp->if_multiaddrs;
|
||||
ifma = (struct ifmultiaddr *)ifma->ifma_link.le_prev) {
|
||||
TAILQ_FOREACH_REVERSE(ifma, &ifp->if_multiaddrs, ifmultihead, ifma_link) {
|
||||
if (ifma->ifma_addr->sa_family != AF_LINK)
|
||||
continue;
|
||||
/*
|
||||
|
@ -521,7 +521,7 @@ static void sis_setmulti_ns(sc)
|
||||
CSR_WRITE_4(sc, SIS_RXFILT_DATA, 0);
|
||||
}
|
||||
|
||||
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;
|
||||
h = sis_crc(sc, LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
|
||||
@ -563,7 +563,7 @@ static void sis_setmulti_sis(sc)
|
||||
}
|
||||
|
||||
/* 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;
|
||||
h = sis_crc(sc, LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
|
||||
|
@ -557,14 +557,7 @@ static void sk_setmulti(sc_if)
|
||||
hashes[1] = 0xFFFFFFFF;
|
||||
} else {
|
||||
i = 1;
|
||||
/* First find the tail of the list. */
|
||||
LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
|
||||
if (LIST_NEXT(ifma, ifma_link) == NULL)
|
||||
break;
|
||||
}
|
||||
/* Now traverse the list backwards. */
|
||||
for (; ifma != NULL && ifma != (void *)&ifp->if_multiaddrs;
|
||||
ifma = (struct ifmultiaddr *)ifma->ifma_link.le_prev) {
|
||||
TAILQ_FOREACH_REVERSE(ifma, &ifp->if_multiaddrs, ifmultihead, ifma_link) {
|
||||
if (ifma->ifma_addr->sa_family != AF_LINK)
|
||||
continue;
|
||||
/*
|
||||
|
@ -587,7 +587,7 @@ static void ste_setmulti(sc)
|
||||
CSR_WRITE_4(sc, STE_MAR1, 0);
|
||||
|
||||
/* 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;
|
||||
h = ste_calchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
|
||||
|
@ -1081,7 +1081,7 @@ static void ti_setmulti(sc)
|
||||
}
|
||||
|
||||
/* 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 ti_mc_entry), M_DEVBUF, M_NOWAIT);
|
||||
|
@ -952,14 +952,7 @@ static void tl_setmulti(sc)
|
||||
hashes[1] = 0xFFFFFFFF;
|
||||
} else {
|
||||
i = 1;
|
||||
/* First find the tail of the list. */
|
||||
LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
|
||||
if (LIST_NEXT(ifma, ifma_link) == NULL)
|
||||
break;
|
||||
}
|
||||
/* Now traverse the list backwards. */
|
||||
for (; ifma != NULL && ifma != (void *)&ifp->if_multiaddrs;
|
||||
ifma = (struct ifmultiaddr *)ifma->ifma_link.le_prev) {
|
||||
TAILQ_FOREACH_REVERSE(ifma, &ifp->if_multiaddrs, ifmultihead, ifma_link) {
|
||||
if (ifma->ifma_addr->sa_family != AF_LINK)
|
||||
continue;
|
||||
/*
|
||||
|
@ -530,7 +530,7 @@ static void vr_setmulti(sc)
|
||||
CSR_WRITE_4(sc, VR_MAR1, 0);
|
||||
|
||||
/* 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;
|
||||
h = vr_calchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
|
||||
|
@ -641,7 +641,7 @@ static void wb_setmulti(sc)
|
||||
CSR_WRITE_4(sc, WB_MAR1, 0);
|
||||
|
||||
/* 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;
|
||||
h = wb_calchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
|
||||
|
@ -518,7 +518,7 @@ wx_mc_setup(sc)
|
||||
}
|
||||
|
||||
sc->wx_nmca = 0;
|
||||
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;
|
||||
}
|
||||
|
@ -808,7 +808,7 @@ static void xl_setmulti(sc)
|
||||
return;
|
||||
}
|
||||
|
||||
LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
|
||||
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
|
||||
mcnt++;
|
||||
|
||||
if (mcnt)
|
||||
@ -851,7 +851,7 @@ static void xl_setmulti_hash(sc)
|
||||
CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_RX_SET_HASH|i);
|
||||
|
||||
/* 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;
|
||||
h = xl_calchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
|
||||
|
@ -398,7 +398,7 @@ intpr(interval, ifnetaddr, pfunc)
|
||||
} msa;
|
||||
const char *fmt;
|
||||
|
||||
LIST_FOREACH(multiaddr, &ifnet.if_multiaddrs, ifma_link) {
|
||||
TAILQ_FOREACH(multiaddr, &ifnet.if_multiaddrs, ifma_link) {
|
||||
if (kread(*(u_long *)multiaddr, (char *)&ifma,
|
||||
sizeof ifma))
|
||||
break;
|
||||
|
@ -203,8 +203,8 @@ if6_addrlist(ifap)
|
||||
|
||||
KREAD(ifap0, &ifa, struct ifaddr);
|
||||
KREAD(ifa.ifa_ifp, &ifnet, struct ifnet);
|
||||
if (LIST_FIRST(&ifnet.if_multiaddrs))
|
||||
ifmp = LIST_FIRST(&ifnet.if_multiaddrs);
|
||||
if (TAILQ_FIRST(&ifnet.if_multiaddrs))
|
||||
ifmp = TAILQ_FIRST(&ifnet.if_multiaddrs);
|
||||
while (ifmp) {
|
||||
KREAD(ifmp, &ifm, struct ifmultiaddr);
|
||||
if (ifm.ifma_addr == NULL)
|
||||
@ -221,7 +221,7 @@ if6_addrlist(ifap)
|
||||
ether_ntoa((struct ether_addr *)LLADDR(&sdl)),
|
||||
ifm.ifma_refcount);
|
||||
nextmulti:
|
||||
ifmp = LIST_NEXT(&ifm, ifma_link);
|
||||
ifmp = TAILQ_NEXT(&ifm, ifma_link);
|
||||
}
|
||||
}
|
||||
#ifdef N_IN6_MK
|
||||
|
Loading…
Reference in New Issue
Block a user