network code: Convert if_multiaddrs from LIST to TAILQ.
authorSascha Wildner <saw@online.de>
Sat, 12 Jun 2010 16:45:16 +0000 (18:45 +0200)
committerSascha Wildner <saw@online.de>
Sat, 12 Jun 2010 17:17:41 +0000 (19:17 +0200)
It can then be traversed backwards in the three drivers which want
to do that.

Taken-from: FreeBSD

64 files changed:
sys/dev/netif/ae/if_ae.c
sys/dev/netif/age/if_age.c
sys/dev/netif/alc/if_alc.c
sys/dev/netif/ale/if_ale.c
sys/dev/netif/ath/ath/if_ath.c
sys/dev/netif/aue/if_aue.c
sys/dev/netif/axe/if_axe.c
sys/dev/netif/bce/if_bce.c
sys/dev/netif/bfe/if_bfe.c
sys/dev/netif/bge/if_bge.c
sys/dev/netif/cue/if_cue.c
sys/dev/netif/dc/if_dc.c
sys/dev/netif/de/if_de.c
sys/dev/netif/e1000/if_em.c
sys/dev/netif/e1000/if_igb.c
sys/dev/netif/ed/if_ed.c
sys/dev/netif/em/if_em.c
sys/dev/netif/emx/if_emx.c
sys/dev/netif/et/if_et.c
sys/dev/netif/fe/if_fe.c
sys/dev/netif/fxp/if_fxp.c
sys/dev/netif/ie/if_ie.c
sys/dev/netif/jme/if_jme.c
sys/dev/netif/kue/if_kue.c
sys/dev/netif/le/if_le.c
sys/dev/netif/lge/if_lge.c
sys/dev/netif/lnc/lance.c
sys/dev/netif/msk/if_msk.c
sys/dev/netif/mxge/if_mxge.c
sys/dev/netif/my/if_my.c
sys/dev/netif/nfe/if_nfe.c
sys/dev/netif/nge/if_nge.c
sys/dev/netif/pcn/if_pcn.c
sys/dev/netif/re/if_re.c
sys/dev/netif/rl/if_rl.c
sys/dev/netif/rtw/rtw.c
sys/dev/netif/rue/if_rue.c
sys/dev/netif/sf/if_sf.c
sys/dev/netif/sis/if_sis.c
sys/dev/netif/sk/if_sk.c
sys/dev/netif/sln/if_sln.c
sys/dev/netif/sn/if_sn.c
sys/dev/netif/ste/if_ste.c
sys/dev/netif/stge/if_stge.c
sys/dev/netif/ti/if_ti.c
sys/dev/netif/tl/if_tl.c
sys/dev/netif/tx/if_tx.c
sys/dev/netif/txp/if_txp.c
sys/dev/netif/vge/if_vge.c
sys/dev/netif/vr/if_vr.c
sys/dev/netif/wb/if_wb.c
sys/dev/netif/wi/if_wi.c
sys/dev/netif/wl/if_wl.c
sys/dev/netif/xe/if_xe.c
sys/dev/netif/xl/if_xl.c
sys/net/if.c
sys/net/if_var.h
sys/net/vlan/if_vlan.c
sys/netinet/in_var.h
sys/netinet6/in6_var.h
sys/netinet6/mld6.c
sys/netproto/802_11/wlan/ieee80211_ioctl.c
usr.bin/netstat/if.c
usr.sbin/ifmcstat/ifmcstat.c

index 2d8267a..931fb89 100644 (file)
@@ -1054,7 +1054,7 @@ ae_rxfilter(struct ae_softc *sc)
         * Load multicast tables.
         */
        bzero(mchash, sizeof(mchash));
-       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;
                crc = ether_crc32_le(LLADDR((struct sockaddr_dl *)
index c4d521d..0aaf7eb 100644 (file)
@@ -2845,7 +2845,7 @@ age_rxfilter(struct age_softc *sc)
        /* Program new filter. */
        bzero(mchash, sizeof(mchash));
 
-       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;
                crc = ether_crc32_le(LLADDR((struct sockaddr_dl *)
index 28c6f63..89e99df 100644 (file)
@@ -3507,7 +3507,7 @@ alc_rxfilter(struct alc_softc *sc)
        /* XXX */
        if_maddr_rlock(ifp);
 #endif
-       LIST_FOREACH(ifma, &sc->alc_ifp->if_multiaddrs, ifma_link) {
+       TAILQ_FOREACH(ifma, &sc->alc_ifp->if_multiaddrs, ifma_link) {
                if (ifma->ifma_addr->sa_family != AF_LINK)
                        continue;
                crc = ether_crc32_be(LLADDR((struct sockaddr_dl *)
index 7dec8af..eb53e11 100644 (file)
@@ -2728,7 +2728,7 @@ ale_rxfilter(struct ale_softc *sc)
        /* Program new filter. */
        bzero(mchash, sizeof(mchash));
 
-       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;
                crc = ether_crc32_le(LLADDR((struct sockaddr_dl *)
index e47549a..54fb0fb 100644 (file)
@@ -2464,7 +2464,7 @@ ath_update_mcast(struct ifnet *ifp)
 #ifdef __FreeBSD__
                if_maddr_rlock(ifp);    /* XXX need some fiddling to remove? */
 #endif
-               LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+               TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
                        caddr_t dl;
                        u_int32_t val;
                        u_int8_t pos;
index 5d0aeaf..f424d56 100644 (file)
@@ -525,7 +525,7 @@ aue_setmulti(struct aue_softc *sc)
                aue_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;
index 91fcc7f..aba6902 100644 (file)
@@ -330,7 +330,7 @@ axe_setmulti(struct axe_softc *sc)
        } else
                rxmode &= ~AXE_RXCMD_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 = ether_crc32_be(
index b0e06ed..23cd3d0 100644 (file)
@@ -4913,7 +4913,7 @@ bce_set_rx_mode(struct bce_softc *sc)
                /* Accept one or more multicast(s). */
                DBPRINT(sc, BCE_INFO, "Enabling selective multicast mode.\n");
 
-               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 = ether_crc32_le(
index bf2d016..b616c3d 100644 (file)
@@ -893,7 +893,7 @@ bfe_set_rx_mode(struct bfe_softc *sc)
                val |= BFE_RXCONF_ALLMULTI;
        } else {
                val &= ~BFE_RXCONF_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;
                        bfe_cam_write(sc,
index fcd0b89..8945d92 100644 (file)
@@ -1164,7 +1164,7 @@ bge_setmulti(struct bge_softc *sc)
                CSR_WRITE_4(sc, BGE_MAR0 + (i * 4), 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 = ether_crc32_le(
index 5a16abf..87c3d57 100644 (file)
@@ -338,7 +338,7 @@ cue_setmulti(struct cue_softc *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;
index ae17a17..5952043 100644 (file)
@@ -1075,7 +1075,7 @@ dc_setfilt_21143(struct dc_softc *sc)
                DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI);
 
        crc_mask = dc_crc_mask(sc);
-       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 = ether_crc32_le(
@@ -1153,7 +1153,7 @@ dc_setfilt_admtek(struct dc_softc *sc)
                crc_mask = dc_crc_mask(sc);
        else
                crc_mask = 0x3f;
-       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 (DC_IS_CENTAUR(sc)) {
@@ -1230,7 +1230,7 @@ dc_setfilt_asix(struct dc_softc *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 = ether_crc32_be(
@@ -1290,7 +1290,7 @@ dc_setfilt_xircom(struct dc_softc *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_mchash_xircom(sc,
index 420dcb6..1ad2940 100644 (file)
@@ -2756,7 +2756,7 @@ tulip_addr_filter(tulip_softc_t *sc)
 #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++;
     }
@@ -2783,7 +2783,7 @@ tulip_addr_filter(tulip_softc_t *sc)
         */
        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;
 
@@ -2832,7 +2832,7 @@ tulip_addr_filter(tulip_softc_t *sc)
            /*
             * 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);
index cbdb4a9..7061216 100644 (file)
@@ -2438,7 +2438,7 @@ em_set_multi(struct adapter *adapter)
        if_maddr_rlock(ifp);
 #endif
 #endif
-       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;
 
index 8115031..c585779 100644 (file)
@@ -1860,7 +1860,7 @@ igb_set_multi(struct adapter *adapter)
 #endif
 #endif
 
-       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;
 
index 60159a1..aea0a5a 100644 (file)
@@ -3457,7 +3457,7 @@ ds_getmcaf(struct ed_softc *sc, u_int32_t *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_mchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr))
index 8e21c28..d9a3f62 100644 (file)
@@ -1840,7 +1840,7 @@ em_set_multi(struct adapter *adapter)
                msec_delay(5);
        }
 
-       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;
 
index 008189c..51fc3f3 100644 (file)
@@ -1496,7 +1496,7 @@ emx_set_multi(struct emx_softc *sc)
        uint8_t  mta[512]; /* Largest MTS is 4096 bits */
        int mcnt = 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;
 
index 30f6900..60d934e 100644 (file)
@@ -1360,7 +1360,7 @@ et_setmulti(struct et_softc *sc)
        }
 
        count = 0;
-       LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+       TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
                uint32_t *hp, h;
 
                if (ifma->ifma_addr->sa_family != AF_LINK)
index 67eeb24..df0d7c4 100644 (file)
@@ -2077,7 +2077,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));
index a5f0ab3..b8dfaf8 100644 (file)
@@ -2118,7 +2118,7 @@ fxp_mc_addrs(struct fxp_softc *sc)
 
        nmcasts = 0;
        if ((sc->flags & FXP_FLAG_ALL_MCAST) == 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;
                        if (nmcasts >= MAXMCADDR) {
index 722853d..c963df1 100644 (file)
@@ -2134,7 +2134,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;
 
index c4dcc53..b6a90b6 100644 (file)
@@ -2786,7 +2786,7 @@ jme_set_filter(struct jme_softc *sc)
        rxcfg |= RXMAC_MULTICAST;
        bzero(mchash, sizeof(mchash));
 
-       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;
                crc = ether_crc32_be(LLADDR((struct sockaddr_dl *)
index bd665d5..4900745 100644 (file)
@@ -323,12 +323,7 @@ kue_setmulti(struct kue_softc *sc)
 
        sc->kue_rxfilt &= ~KUE_RXFILT_ALLMULTI;
 
-#if defined(__FreeBSD__) && __FreeBSD_version >= 500000
-       TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
-#else
-       LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
-#endif
-       {
+       TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
                if (ifma->ifma_addr->sa_family != AF_LINK)
                        continue;
                /*
index 72d5607..75db45e 100644 (file)
@@ -454,7 +454,7 @@ le_multi_filter(struct le_softc *sc)
 
     sc->le_flags |= IFF_MULTICAST;
 
-    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;
 
index c75c39f..fd88cf4 100644 (file)
@@ -361,7 +361,7 @@ lge_setmulti(struct lge_softc *sc)
        CSR_WRITE_4(sc, LGE_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 = ether_crc32_be(LLADDR((struct sockaddr_dl *)
index 90350de..7817bd0 100644 (file)
@@ -532,7 +532,7 @@ lance_setladrf(struct lance_softc *sc, uint16_t *af)
 
        af[0] = af[1] = af[2] = af[3] = 0x0000;
 
-       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;
 
index 26c04e1..91b4459 100644 (file)
@@ -515,7 +515,7 @@ msk_setmulti(struct msk_if_softc *sc_if)
                        mchash[1] = 0xffff;
                }
        } else {
-               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;
                        crc = ether_crc32_be(LLADDR((struct sockaddr_dl *)
index 208418a..6dd0117 100644 (file)
@@ -1160,7 +1160,7 @@ mxge_set_multicast_list(mxge_softc_t *sc)
 
        /* Walk the multicast list, and add each address */
 
-       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;
                bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr),
index 838d0d1..3156ce6 100644 (file)
@@ -348,7 +348,7 @@ my_setmulti(struct my_softc * sc)
        CSR_WRITE_4(sc, MY_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 = my_calchash(LLADDR((struct sockaddr_dl *) ifma->ifma_addr));
index 5149e96..78fa3ee 100644 (file)
@@ -2106,7 +2106,7 @@ nfe_setmulti(struct nfe_softc *sc)
        bcopy(etherbroadcastaddr, addr, ETHER_ADDR_LEN);
        bcopy(etherbroadcastaddr, mask, ETHER_ADDR_LEN);
 
-       LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+       TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
                caddr_t maddr;
 
                if (ifma->ifma_addr->sa_family != AF_LINK)
index e677e35..8cd17fb 100644 (file)
@@ -648,7 +648,7 @@ nge_setmulti(struct nge_softc *sc)
         * that needs to be updated, and the lower 4 bits represent
         * which bit within that byte needs to be set.
         */
-       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 = ether_crc32_be(LLADDR((struct sockaddr_dl *)
index 425894b..6620b22 100644 (file)
@@ -336,7 +336,7 @@ pcn_setmulti(struct pcn_softc *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));
index 74ed2e5..1444504 100644 (file)
@@ -678,7 +678,7 @@ re_setmulti(struct re_softc *sc)
        CSR_WRITE_4(sc, RE_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 = ether_crc32_be(LLADDR((struct sockaddr_dl *)
index d7d0e83..9663a3d 100644 (file)
@@ -661,7 +661,7 @@ rl_setmulti(struct rl_softc *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 = ether_crc32_be(
index 0c06dce..8e6ab48 100644 (file)
@@ -2551,7 +2551,7 @@ allmulti:
        /*
         * Program the 64-bit multicast hash filter.
         */
-       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;
 
index e731a60..18e65f7 100644 (file)
@@ -460,7 +460,7 @@ rue_setmulti(struct rue_softc *sc)
        rue_csr_write_4(sc, RUE_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 = ether_crc32_be(LLADDR((struct sockaddr_dl *)
index 14c417f..3bebec8 100644 (file)
@@ -436,15 +436,7 @@ sf_setmulti(struct sf_softc *sc)
                SF_SETBIT(sc, SF_RXFILT, SF_RXFILT_ALLMULTI);
        } else {
                i = 1;
-               /* First find the tail of the list. */
-               for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL;
-                                       ifma = ifma->ifma_link.le_next) {
-                       if (ifma->ifma_link.le_next == 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;
                        /*
index 991b9e0..4912456 100644 (file)
@@ -791,7 +791,7 @@ sis_setmulti_ns(struct sis_softc *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_mchash(sc,
@@ -838,7 +838,7 @@ sis_setmulti_sis(struct sis_softc *sc)
                for (i = 0; i < n; i++)
                        hashes[i] = 0;
                i = 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_mchash(sc,
index 3c7904d..cdeacbc 100644 (file)
@@ -604,13 +604,8 @@ sk_setmulti(struct sk_if_softc *sc_if)
        } else {
                i = 1;
                /* First find the tail of the list. */
-               LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
-                       if (ifma->ifma_link.le_next == 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) {
                        caddr_t maddr;
 
                        if (ifma->ifma_addr->sa_family != AF_LINK)
index 68c1b51..87a412b 100644 (file)
@@ -590,7 +590,7 @@ sln_set_multi(struct sln_softc *sc)
        uint32_t crc = 0;
        uint32_t mc_g[2] = {0, 0};
        struct ifmultiaddr *ifma;
-       int i, j;
+       int j;
 
        if (ifp->if_flags & IFF_PROMISC) {
                kprintf("Promisc mode is enabled\n");
@@ -607,9 +607,7 @@ sln_set_multi(struct sln_softc *sc)
                /* first, zero all the existing hash bits */
                mc_g[0] = mc_g[1] = 0;
 
-               for (i = 0, ifma = (ifp->if_multiaddrs.lh_first);
-                    ifma != NULL && (i < ifma->ifma_refcount);
-                    i++, ifma = (ifma->ifma_link.le_next)) {
+               TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
                        j = 0;
 
                        if ((ifma->ifma_addr->sa_family) != AF_LINK)
index 928a432..9bebe24 100644 (file)
@@ -1382,7 +1382,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;
index cf19969..284aa61 100644 (file)
@@ -553,7 +553,7 @@ ste_setmulti(struct ste_softc *sc)
        CSR_WRITE_2(sc, STE_MAR3, 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 = ether_crc32_be(
index a4a3621..2b30b54 100644 (file)
@@ -2413,7 +2413,7 @@ stge_set_multi(struct stge_softc *sc)
        bzero(mchash, sizeof(mchash));
 
        count = 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;
                crc = ether_crc32_be(LLADDR((struct sockaddr_dl *)
index 610d939..e2faa5f 100644 (file)
@@ -1044,7 +1044,7 @@ ti_setmulti(struct ti_softc *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 = kmalloc(sizeof(struct ti_mc_entry), M_DEVBUF, M_INTWAIT);
index e587a41..9bc6c0f 100644 (file)
@@ -905,15 +905,7 @@ tl_setmulti(struct tl_softc *sc)
                hashes[1] = 0xFFFFFFFF;
        } else {
                i = 1;
-               /* First find the tail of the list. */
-               for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL;
-                                       ifma = ifma->ifma_link.le_next) {
-                       if (ifma->ifma_link.le_next == 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;
                        /*
index 6dee9fb..20c6a7f 100644 (file)
@@ -1195,7 +1195,7 @@ epic_set_mc_table(epic_softc_t *sc)
        filter[2] = 0;
        filter[3] = 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 = (ether_crc32_be(
index 9c36f89..5919807 100644 (file)
@@ -1698,7 +1698,7 @@ txp_set_filter(struct txp_softc *sc)
 
                hash[0] = hash[1] = 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;
 
index 53d2173..4eb7207 100644 (file)
@@ -530,7 +530,7 @@ vge_setmulti(struct vge_softc *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;
                error = vge_cam_set(sc,
@@ -543,7 +543,7 @@ vge_setmulti(struct vge_softc *sc)
        if (error) {
                vge_cam_clear(sc);
 
-               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 = ether_crc32_be(LLADDR((struct sockaddr_dl *)
index da6fe7f..ba8e7bd 100644 (file)
@@ -539,7 +539,7 @@ vr_setmulti(struct vr_softc *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) {
                int h;
 
                if (ifma->ifma_addr->sa_family != AF_LINK)
index e76f41a..0457df3 100644 (file)
@@ -551,7 +551,7 @@ wb_setmulti(struct wb_softc *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 = ~ether_crc32_be(LLADDR((struct sockaddr_dl *)
index 6c22d33..cbdccb4 100644 (file)
@@ -1593,7 +1593,7 @@ allmulti:
 #ifdef __FreeBSD__
        if_maddr_rlock(ifp);
 #endif
-       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 >= 16)
index 4c8eaa4..11216e5 100644 (file)
@@ -2145,7 +2145,7 @@ wlconfig(struct wl_softc *sc)
     outw(PIOP1(base), AC_MCSETUP|AC_CW_EL);            /* ac_command */
     outw(PIOR1(base), OFFSET_CU + 8);
 #if defined(__DragonFly__) || (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;
        
index 9aea6f9..c84424e 100644 (file)
@@ -1316,7 +1316,7 @@ xe_set_multicast(struct xe_softc *scp) {
 
   /* Iterate over multicast address list */
   count = 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;
 
index e66e6a4..59631c2 100644 (file)
@@ -734,7 +734,7 @@ xl_setmulti(struct xl_softc *sc)
                return;
        }
 
-       LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
+       TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
                mcnt++;
 
        if (mcnt)
@@ -777,7 +777,7 @@ xl_setmulti_hash(struct xl_softc *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;
 
index 47c9dc4..084de48 100644 (file)
@@ -541,7 +541,7 @@ if_attach(struct ifnet *ifp, lwkt_serialize_t serializer)
                TAILQ_INIT(&ifp->if_addrheads[i]);
 
        TAILQ_INIT(&ifp->if_prefixhead);
-       LIST_INIT(&ifp->if_multiaddrs);
+       TAILQ_INIT(&ifp->if_multiaddrs);
        getmicrotime(&ifp->if_lastchange);
        if (ifindex2ifnet == NULL || if_index >= if_indexlim) {
                unsigned int n;
@@ -1830,7 +1830,7 @@ if_addmulti(
         * 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 (sa_equal(sa, ifma->ifma_addr)) {
                        ifma->ifma_refcount++;
                        if (retifma)
@@ -1870,13 +1870,13 @@ if_addmulti(
         * interrupt time; lock them out.
         */
        crit_enter();
-       LIST_INSERT_HEAD(&ifp->if_multiaddrs, ifma, ifma_link);
+       TAILQ_INSERT_HEAD(&ifp->if_multiaddrs, ifma, ifma_link);
        crit_exit();
        if (retifma)
                *retifma = ifma;
 
        if (llsa != 0) {
-               LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+               TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
                        if (sa_equal(ifma->ifma_addr, llsa))
                                break;
                }
@@ -1892,7 +1892,7 @@ if_addmulti(
                        ifma->ifma_ifp = ifp;
                        ifma->ifma_refcount = 1;
                        crit_enter();
-                       LIST_INSERT_HEAD(&ifp->if_multiaddrs, ifma, ifma_link);
+                       TAILQ_INSERT_HEAD(&ifp->if_multiaddrs, ifma, ifma_link);
                        crit_exit();
                }
        }
@@ -1919,7 +1919,7 @@ if_delmulti(struct ifnet *ifp, struct sockaddr *sa)
 {
        struct ifmultiaddr *ifma;
 
-       LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
+       TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
                if (sa_equal(sa, ifma->ifma_addr))
                        break;
        if (ifma == 0)
@@ -1933,7 +1933,7 @@ if_delmulti(struct ifnet *ifp, struct sockaddr *sa)
        rt_newmaddrmsg(RTM_DELMADDR, ifma);
        sa = ifma->ifma_lladdr;
        crit_enter();
-       LIST_REMOVE(ifma, ifma_link);
+       TAILQ_REMOVE(&ifp->if_multiaddrs, ifma, ifma_link);
        /*
         * Make sure the interface driver is notified
         * in the case of a link layer mcast group being left.
@@ -1960,7 +1960,7 @@ if_delmulti(struct ifnet *ifp, struct sockaddr *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 (sa_equal(sa, ifma->ifma_addr))
                        break;
        if (ifma == 0)
@@ -1973,7 +1973,7 @@ if_delmulti(struct ifnet *ifp, struct sockaddr *sa)
 
        crit_enter();
        ifnet_serialize_all(ifp);
-       LIST_REMOVE(ifma, ifma_link);
+       TAILQ_REMOVE(&ifp->if_multiaddrs, ifma, ifma_link);
        ifp->if_ioctl(ifp, SIOCDELMULTI, 0, NULL);
        ifnet_deserialize_all(ifp);
        crit_exit();
@@ -1994,7 +1994,7 @@ if_delallmulti(struct ifnet *ifp)
        struct ifmultiaddr *ifma;
        struct ifmultiaddr *next;
 
-       LIST_FOREACH_MUTABLE(ifma, &ifp->if_multiaddrs, ifma_link, next)
+       TAILQ_FOREACH_MUTABLE(ifma, &ifp->if_multiaddrs, ifma_link, next)
                if_delmulti(ifp, ifma->ifma_addr);
 }
 
@@ -2068,7 +2068,7 @@ ifmaof_ifpforaddr(struct sockaddr *sa, struct ifnet *ifp)
 {
        struct ifmultiaddr *ifma;
 
-       LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
+       TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
                if (sa_equal(ifma->ifma_addr, sa))
                        break;
 
index 40a78cb..8259fad 100644 (file)
@@ -108,7 +108,7 @@ struct      ifpoll_info;
 TAILQ_HEAD(ifnethead, ifnet);  /* we use TAILQs so that the order of */
 TAILQ_HEAD(ifaddrhead, ifaddr_container); /* 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.
@@ -572,7 +572,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 */
index 4fff5b0..d505c43 100644 (file)
@@ -256,7 +256,7 @@ vlan_setmulti(struct ifvlan *ifv, struct ifnet *ifp_p)
        sdl.sdl_type = IFT_ETHER;
        sdl.sdl_alen = ETHER_ADDR_LEN;
 
-       LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+       TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
                int error;
 
                if (ifma->ifma_addr->sa_family != AF_LINK)
index 3085f69..a8283a1 100644 (file)
@@ -204,7 +204,7 @@ struct in_multistep {
 do { \
        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) \
index 58cc994..af120ac 100644 (file)
@@ -564,8 +564,7 @@ struct      in6_multistep {
 /* struct in6_multi *in6m; */                                  \
 do { \
        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))) \
index ed37233..5f1088c 100644 (file)
@@ -265,7 +265,7 @@ mld6_input(struct mbuf *m, int 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;
index dd5f10d..5e44f28 100644 (file)
@@ -3214,7 +3214,7 @@ ieee80211_ioctl_updatemulti(struct ieee80211com *ic)
                struct ifnet *ifp = vap->iv_ifp;
                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_LINK)
                                continue;
                        (void) if_addmulti(parent, ifma->ifma_addr, NULL);
index 496f5bf..b79fd58 100644 (file)
@@ -422,7 +422,7 @@ intpr(int interval1, u_long ifnetaddr, void (*pfunc)(char *))
                        /*
                         * Print family's multicast addresses
                         */
-                       u_long multiaddr;
+                       struct ifmultiaddr *multiaddr;
                        struct ifmultiaddr ifma;
                        union {
                                struct sockaddr sa;
@@ -434,12 +434,11 @@ intpr(int interval1, u_long ifnetaddr, void (*pfunc)(char *))
                        } msa;
                        const char *fmt;
 
-                       for(multiaddr = (u_long)ifnet.if_multiaddrs.lh_first;
-                           multiaddr;
-                           multiaddr = (u_long)ifma.ifma_link.le_next) {
-                               if (kread(multiaddr, (char *)&ifma,
+                       TAILQ_FOREACH(multiaddr, &ifnet.if_multiaddrs, ifma_link) {
+                               if (kread((u_long)multiaddr, (char *)&ifma,
                                          sizeof ifma))
                                        break;
+                               multiaddr = &ifma;
                                if (kread((u_long)ifma.ifma_addr, (char *)&msa,
                                          sizeof msa))
                                        break;
index 48071e4..741c96b 100644 (file)
@@ -223,8 +223,8 @@ if6_addrlist(struct ifaddr_container *ifac)
 
                KREAD(ifap0, &ifa, struct ifaddr);
                KREAD(ifa.ifa_ifp, &ifnet, struct ifnet);
-               if (ifnet.if_multiaddrs.lh_first)
-                       ifmp = ifnet.if_multiaddrs.lh_first;
+               if (TAILQ_FIRST(&ifnet.if_multiaddrs))
+                       ifmp = TAILQ_FIRST(&ifnet.if_multiaddrs);
                while (ifmp) {
                        KREAD(ifmp, &ifm, struct ifmultiaddr);
                        if (ifm.ifma_addr == NULL)
@@ -240,7 +240,7 @@ if6_addrlist(struct ifaddr_container *ifac)
                               ether_ntoa((struct ether_addr *)LLADDR(&sdl)),
                               ifm.ifma_refcount);
                    nextmulti:
-                       ifmp = ifm.ifma_link.le_next;
+                       ifmp = TAILQ_NEXT(&ifm, ifma_link);
                }
        }
 #ifdef N_IN6_MK