Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107763243
D15366.id42392.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
113 KB
Referenced Files
None
Subscribers
None
D15366.id42392.diff
View Options
Index: sys/arm/allwinner/if_emac.c
===================================================================
--- sys/arm/allwinner/if_emac.c
+++ sys/arm/allwinner/if_emac.c
@@ -240,7 +240,7 @@
hashes[1] = 0xffffffff;
} else {
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &sc->emac_ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &sc->emac_ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
h = ether_crc32_be(LLADDR((struct sockaddr_dl *)
Index: sys/arm/at91/if_ate.c
===================================================================
--- sys/arm/at91/if_ate.c
+++ sys/arm/at91/if_ate.c
@@ -535,7 +535,7 @@
mcaf[0] = 0;
mcaf[1] = 0;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
index = ate_mac_hash(LLADDR((struct sockaddr_dl *)
Index: sys/arm/at91/if_macb.c
===================================================================
--- sys/arm/at91/if_macb.c
+++ sys/arm/at91/if_macb.c
@@ -1137,7 +1137,7 @@
multicast_filter[0] = 0;
multicast_filter[1] = 0;
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
count++;
Index: sys/arm/cavium/cns11xx/if_ece.c
===================================================================
--- sys/arm/cavium/cns11xx/if_ece.c
+++ sys/arm/cavium/cns11xx/if_ece.c
@@ -1839,7 +1839,7 @@
return;
}
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
add_mac_entry(sc,
Index: sys/arm/ralink/if_fv.c
===================================================================
--- sys/arm/ralink/if_fv.c
+++ sys/arm/ralink/if_fv.c
@@ -227,7 +227,7 @@
i = 0;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
ma = LLADDR((struct sockaddr_dl *)ifma->ifma_addr);
Index: sys/arm/ti/cpsw/if_cpsw.c
===================================================================
--- sys/arm/ti/cpsw/if_cpsw.c
+++ sys/arm/ti/cpsw/if_cpsw.c
@@ -2465,7 +2465,7 @@
/* Set other multicast addrs desired. */
if_maddr_rlock(sc->ifp);
- TAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
cpsw_ale_mc_entry_set(sc->swsc, portmask, sc->vlan,
Index: sys/arm/xscale/ixp425/if_npe.c
===================================================================
--- sys/arm/xscale/ixp425/if_npe.c
+++ sys/arm/xscale/ixp425/if_npe.c
@@ -435,7 +435,7 @@
memset(set, 0xff, ETHER_ADDR_LEN);
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
mac = LLADDR((struct sockaddr_dl *) ifma->ifma_addr);
Index: sys/compat/linux/linux_ioctl.c
===================================================================
--- sys/compat/linux/linux_ioctl.c
+++ sys/compat/linux/linux_ioctl.c
@@ -2241,7 +2241,7 @@
ifc.ifc_len = 0;
IFNET_RLOCK();
TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
struct sockaddr *sa = ifa->ifa_addr;
if (sa->sa_family == AF_INET)
ifc.ifc_len += sizeof(ifr);
@@ -2282,7 +2282,7 @@
strlcpy(ifr.ifr_name, ifp->if_xname, LINUX_IFNAMSIZ);
/* Walk the address list */
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
struct sockaddr *sa = ifa->ifa_addr;
if (sa->sa_family == AF_INET) {
@@ -2361,7 +2361,7 @@
if (ifp->if_type != IFT_ETHER)
return (ENOENT);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
sdl = (struct sockaddr_dl*)ifa->ifa_addr;
if (sdl != NULL && (sdl->sdl_family == AF_LINK) &&
(sdl->sdl_type == IFT_ETHER)) {
Index: sys/contrib/ipfilter/netinet/ip_compat.h
===================================================================
--- sys/contrib/ipfilter/netinet/ip_compat.h
+++ sys/contrib/ipfilter/netinet/ip_compat.h
@@ -227,7 +227,7 @@
struct mbuf;
struct ifnet {
char if_xname[IFNAMSIZ];
- TAILQ_HEAD(, ifaddr) if_addrlist;
+ STAILQ_HEAD(, ifaddr) if_addrlist;
int (*if_output)(struct ifnet *, struct mbuf *,
const struct sockaddr *, struct route *);
};
Index: sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
===================================================================
--- sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
+++ sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
@@ -1021,7 +1021,7 @@
else if (v == 6)
bzero((char *)inp, sizeof(*inp));
#endif
- ifa = TAILQ_FIRST(&ifp->if_addrhead);
+ ifa = CK_STAILQ_FIRST(&ifp->if_addrhead);
sock = ifa->ifa_addr;
while (sock != NULL && ifa != NULL) {
@@ -1036,7 +1036,7 @@
break;
}
#endif
- ifa = TAILQ_NEXT(ifa, ifa_link);
+ ifa = CK_STAILQ_NEXT(ifa, ifa_link);
if (ifa != NULL)
sock = ifa->ifa_addr;
}
Index: sys/dev/ae/if_ae.c
===================================================================
--- sys/dev/ae/if_ae.c
+++ sys/dev/ae/if_ae.c
@@ -2071,7 +2071,7 @@
*/
bzero(mchash, sizeof(mchash));
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_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: sys/dev/age/if_age.c
===================================================================
--- sys/dev/age/if_age.c
+++ sys/dev/age/if_age.c
@@ -3170,7 +3170,7 @@
bzero(mchash, sizeof(mchash));
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &sc->age_ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &sc->age_ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
crc = ether_crc32_be(LLADDR((struct sockaddr_dl *)
Index: sys/dev/al_eth/al_eth.c
===================================================================
--- sys/dev/al_eth/al_eth.c
+++ sys/dev/al_eth/al_eth.c
@@ -2891,7 +2891,7 @@
unsigned char *mac;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
if (mc == MAX_NUM_MULTICAST_ADDRESSES)
@@ -2905,7 +2905,7 @@
if_maddr_runlock(ifp);
if_addr_rlock(ifp);
- TAILQ_FOREACH(ifua, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifua, &ifp->if_addrhead, ifa_link) {
if (ifua->ifa_addr->sa_family != AF_LINK)
continue;
if (uc == MAX_NUM_ADDRESSES)
@@ -2951,7 +2951,7 @@
/* set new addresses */
i = AL_ETH_MAC_TABLE_UNICAST_IDX_BASE + 1;
if_addr_rlock(ifp);
- TAILQ_FOREACH(ifua, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifua, &ifp->if_addrhead, ifa_link) {
if (ifua->ifa_addr->sa_family != AF_LINK) {
continue;
}
Index: sys/dev/alc/if_alc.c
===================================================================
--- sys/dev/alc/if_alc.c
+++ sys/dev/alc/if_alc.c
@@ -4608,7 +4608,7 @@
}
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &sc->alc_ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_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: sys/dev/ale/if_ale.c
===================================================================
--- sys/dev/ale/if_ale.c
+++ sys/dev/ale/if_ale.c
@@ -3038,7 +3038,7 @@
bzero(mchash, sizeof(mchash));
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &sc->ale_ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &sc->ale_ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
crc = ether_crc32_be(LLADDR((struct sockaddr_dl *)
Index: sys/dev/altera/atse/if_atse.c
===================================================================
--- sys/dev/altera/atse/if_atse.c
+++ sys/dev/altera/atse/if_atse.c
@@ -485,7 +485,7 @@
* do all the programming afterwards.
*/
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK) {
continue;
}
Index: sys/dev/ath/if_ath.c
===================================================================
--- sys/dev/ath/if_ath.c
+++ sys/dev/ath/if_ath.c
@@ -3615,7 +3615,7 @@
TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
ifp = vap->iv_ifp;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
caddr_t dl;
uint32_t val;
uint8_t pos;
Index: sys/dev/bce/if_bce.c
===================================================================
--- sys/dev/bce/if_bce.c
+++ sys/dev/bce/if_bce.c
@@ -8117,7 +8117,7 @@
DBPRINT(sc, BCE_INFO_MISC, "Enabling selective multicast mode.\n");
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
h = ether_crc32_le(LLADDR((struct sockaddr_dl *)
Index: sys/dev/bfe/if_bfe.c
===================================================================
--- sys/dev/bfe/if_bfe.c
+++ sys/dev/bfe/if_bfe.c
@@ -1109,7 +1109,7 @@
else {
val &= ~BFE_RXCONF_ALLMULTI;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
bfe_cam_write(sc,
Index: sys/dev/bm/if_bm.c
===================================================================
--- sys/dev/bm/if_bm.c
+++ sys/dev/bm/if_bm.c
@@ -939,7 +939,7 @@
memset(hash, 0, sizeof(hash));
if_maddr_rlock(ifp);
- TAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) {
if (inm->ifma_addr->sa_family != AF_LINK)
continue;
crc = ether_crc32_le(LLADDR((struct sockaddr_dl *)
Index: sys/dev/bxe/bxe.c
===================================================================
--- sys/dev/bxe/bxe.c
+++ sys/dev/bxe/bxe.c
@@ -12004,7 +12004,7 @@
struct ifmultiaddr *ifma;
struct ecore_mcast_list_elem *mc_mac;
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK) {
continue;
}
@@ -12027,7 +12027,7 @@
}
bzero(mc_mac, (sizeof(*mc_mac) * mc_count));
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK) {
continue;
}
@@ -12130,7 +12130,7 @@
ifa = if_getifaddr(ifp); /* XXX Is this structure */
while (ifa) {
if (ifa->ifa_addr->sa_family != AF_LINK) {
- ifa = TAILQ_NEXT(ifa, ifa_link);
+ ifa = CK_STAILQ_NEXT(ifa, ifa_link);
continue;
}
@@ -12150,7 +12150,7 @@
return (rc);
}
- ifa = TAILQ_NEXT(ifa, ifa_link);
+ ifa = CK_STAILQ_NEXT(ifa, ifa_link);
}
#if __FreeBSD_version < 800000
Index: sys/dev/cas/if_cas.c
===================================================================
--- sys/dev/cas/if_cas.c
+++ sys/dev/cas/if_cas.c
@@ -2546,7 +2546,7 @@
memset(hash, 0, sizeof(hash));
if_maddr_rlock(ifp);
- TAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) {
if (inm->ifma_addr->sa_family != AF_LINK)
continue;
crc = ether_crc32_le(LLADDR((struct sockaddr_dl *)
Index: sys/dev/cs/if_cs.c
===================================================================
--- sys/dev/cs/if_cs.c
+++ sys/dev/cs/if_cs.c
@@ -1007,7 +1007,7 @@
* frames we're interested in.
*/
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
struct sockaddr_dl *dl =
(struct sockaddr_dl *)ifma->ifma_addr;
Index: sys/dev/cxgb/cxgb_adapter.h
===================================================================
--- sys/dev/cxgb/cxgb_adapter.h
+++ sys/dev/cxgb/cxgb_adapter.h
@@ -471,7 +471,7 @@
int i = 0;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
if (i == rm->idx) {
Index: sys/dev/cxgbe/t4_main.c
===================================================================
--- sys/dev/cxgbe/t4_main.c
+++ sys/dev/cxgbe/t4_main.c
@@ -4209,7 +4209,7 @@
int i = 0, j;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
mcaddr[i] =
Index: sys/dev/cxgbe/tom/t4_tom.c
===================================================================
--- sys/dev/cxgbe/tom/t4_tom.c
+++ sys/dev/cxgbe/tom/t4_tom.c
@@ -965,7 +965,7 @@
/* XXX: races with if_vmove */
CURVNET_SET(vi->ifp->if_vnet);
- TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) {
+ CK_STAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) {
lip = &ia->ia_addr.sin6_addr;
KASSERT(!IN6_IS_ADDR_MULTICAST(lip),
Index: sys/dev/dc/if_dc.c
===================================================================
--- sys/dev/dc/if_dc.c
+++ sys/dev/dc/if_dc.c
@@ -997,7 +997,7 @@
DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI);
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
h = dc_mchash_le(sc,
@@ -1075,7 +1075,7 @@
/* Now program new ones. */
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
if (DC_IS_CENTAUR(sc))
@@ -1148,7 +1148,7 @@
/* now program new ones */
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
h = dc_mchash_be(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
@@ -1209,7 +1209,7 @@
/* Now build perfect filters. */
mcnt = 0;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
if (mcnt >= DC_ULI_FILTER_NPERF) {
@@ -1294,7 +1294,7 @@
DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI);
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
h = dc_mchash_le(sc,
Index: sys/dev/de/if_de.c
===================================================================
--- sys/dev/de/if_de.c
+++ sys/dev/de/if_de.c
@@ -3053,7 +3053,7 @@
else
bcopy(sc->tulip_enaddr, eaddr, ETHER_ADDR_LEN);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family == AF_LINK)
multicnt++;
@@ -3080,7 +3080,7 @@
*/
bzero(sc->tulip_setupdata, sizeof(sc->tulip_setupdata));
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
@@ -3112,7 +3112,7 @@
/*
* Else can get perfect filtering for 16 addresses.
*/
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
addrp = LLADDR((struct sockaddr_dl *)ifma->ifma_addr);
Index: sys/dev/dwc/if_dwc.c
===================================================================
--- sys/dev/dwc/if_dwc.c
+++ sys/dev/dwc/if_dwc.c
@@ -607,7 +607,7 @@
for (i = 0; i < nhash; i++)
hash[i] = 0;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
crc = ether_crc32_le(LLADDR((struct sockaddr_dl *)
Index: sys/dev/ed/if_ed.c
===================================================================
--- sys/dev/ed/if_ed.c
+++ sys/dev/ed/if_ed.c
@@ -1701,7 +1701,7 @@
mcaf[1] = 0;
if_maddr_rlock(sc->ifp);
- TAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
index = ether_crc32_be(LLADDR((struct sockaddr_dl *)
Index: sys/dev/et/if_et.c
===================================================================
--- sys/dev/et/if_et.c
+++ sys/dev/et/if_et.c
@@ -1581,7 +1581,7 @@
count = 0;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
uint32_t *hp, h;
if (ifma->ifma_addr->sa_family != AF_LINK)
Index: sys/dev/ex/if_ex.c
===================================================================
--- sys/dev/ex/if_ex.c
+++ sys/dev/ex/if_ex.c
@@ -866,7 +866,7 @@
count = 0;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(maddr, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(maddr, &ifp->if_multiaddrs, ifma_link) {
if (maddr->ifma_addr->sa_family != AF_LINK)
continue;
count++;
@@ -900,7 +900,7 @@
CSR_WRITE_2(sc, IO_PORT_REG, (count + 1) * 6);
if_maddr_rlock(ifp);
- TAILQ_FOREACH(maddr, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(maddr, &ifp->if_multiaddrs, ifma_link) {
if (maddr->ifma_addr->sa_family != AF_LINK)
continue;
Index: sys/dev/fe/if_fe.c
===================================================================
--- sys/dev/fe/if_fe.c
+++ sys/dev/fe/if_fe.c
@@ -2076,7 +2076,7 @@
filter = fe_filter_nothing;
if_maddr_rlock(sc->ifp);
- TAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
index = ether_crc32_le(LLADDR((struct sockaddr_dl *)
Index: sys/dev/ffec/if_ffec.c
===================================================================
--- sys/dev/ffec/if_ffec.c
+++ sys/dev/ffec/if_ffec.c
@@ -994,7 +994,7 @@
else {
ghash = 0;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
/* 6 bits from MSB in LE CRC32 are used for hash. */
Index: sys/dev/gem/if_gem.c
===================================================================
--- sys/dev/gem/if_gem.c
+++ sys/dev/gem/if_gem.c
@@ -2249,7 +2249,7 @@
memset(hash, 0, sizeof(hash));
if_maddr_rlock(ifp);
- TAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) {
if (inm->ifma_addr->sa_family != AF_LINK)
continue;
crc = ether_crc32_le(LLADDR((struct sockaddr_dl *)
Index: sys/dev/hme/if_hme.c
===================================================================
--- sys/dev/hme/if_hme.c
+++ sys/dev/hme/if_hme.c
@@ -1723,7 +1723,7 @@
*/
if_maddr_rlock(ifp);
- TAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) {
if (inm->ifma_addr->sa_family != AF_LINK)
continue;
crc = ether_crc32_le(LLADDR((struct sockaddr_dl *)
Index: sys/dev/hyperv/netvsc/if_hn.c
===================================================================
--- sys/dev/hyperv/netvsc/if_hn.c
+++ sys/dev/hyperv/netvsc/if_hn.c
@@ -931,7 +931,7 @@
filter |= NDIS_PACKET_TYPE_BROADCAST;
/* TODO: support multicast list */
if ((ifp->if_flags & IFF_ALLMULTI) ||
- !TAILQ_EMPTY(&ifp->if_multiaddrs))
+ !CK_STAILQ_EMPTY(&ifp->if_multiaddrs))
filter |= NDIS_PACKET_TYPE_ALL_MULTICAST;
}
return (hn_set_rxfilter(sc, filter));
@@ -1323,7 +1323,7 @@
HN_LOCK_ASSERT(sc);
/* XXX vlan(4) style mcast addr maintenance */
- if (!TAILQ_EMPTY(&ifp->if_multiaddrs))
+ if (!CK_STAILQ_EMPTY(&ifp->if_multiaddrs))
allmulti = IFF_ALLMULTI;
/* Always set the VF's if_flags */
Index: sys/dev/if_ndis/if_ndis.c
===================================================================
--- sys/dev/if_ndis/if_ndis.c
+++ sys/dev/if_ndis/if_ndis.c
@@ -313,7 +313,7 @@
return;
}
- if (TAILQ_EMPTY(&ifp->if_multiaddrs))
+ if (CK_STAILQ_EMPTY(&ifp->if_multiaddrs))
return;
len = sizeof(mclistsz);
@@ -330,7 +330,7 @@
len = 0;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_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: sys/dev/ixgbe/if_ixv.c
===================================================================
--- sys/dev/ixgbe/if_ixv.c
+++ sys/dev/ixgbe/if_ixv.c
@@ -846,7 +846,7 @@
IOCTL_DEBUGOUT("ixv_if_multi_set: begin");
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_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: sys/dev/ixl/if_ixlv.c
===================================================================
--- sys/dev/ixl/if_ixlv.c
+++ sys/dev/ixl/if_ixlv.c
@@ -2433,7 +2433,7 @@
** Get a count, to decide if we
** simply use multicast promiscuous.
*/
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
mcnt++;
@@ -2454,7 +2454,7 @@
mcnt = 0;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
if (!ixlv_add_mac_filter(sc,
@@ -2494,7 +2494,7 @@
&& (f->flags & IXL_FILTER_MC)) {
/* check if mac address in filter is in sc's list */
match = FALSE;
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
u8 *mc_addr =
Index: sys/dev/ixl/ixl_pf_main.c
===================================================================
--- sys/dev/ixl/ixl_pf_main.c
+++ sys/dev/ixl/ixl_pf_main.c
@@ -876,7 +876,7 @@
else { /* Need to count the multicast addresses */
struct ifmultiaddr *ifma;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
if (mcnt == MAX_MULTICAST_ADDR) {
@@ -916,7 +916,7 @@
** First just get a count, to decide if we
** we simply use multicast promiscuous.
*/
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
mcnt++;
@@ -933,7 +933,7 @@
mcnt = 0;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
ixl_add_mc_filter(vsi,
@@ -966,7 +966,7 @@
SLIST_FOREACH(f, &vsi->ftl, next) {
if ((f->flags & IXL_FILTER_USED) && (f->flags & IXL_FILTER_MC)) {
match = FALSE;
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
u8 *mc_addr = (u8 *)LLADDR((struct sockaddr_dl *)ifma->ifma_addr);
Index: sys/dev/jme/if_jme.c
===================================================================
--- sys/dev/jme/if_jme.c
+++ sys/dev/jme/if_jme.c
@@ -3278,7 +3278,7 @@
bzero(mchash, sizeof(mchash));
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &sc->jme_ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &sc->jme_ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
crc = ether_crc32_be(LLADDR((struct sockaddr_dl *)
Index: sys/dev/le/lance.c
===================================================================
--- sys/dev/le/lance.c
+++ sys/dev/le/lance.c
@@ -602,7 +602,7 @@
af[0] = af[1] = af[2] = af[3] = 0x0000;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
Index: sys/dev/lge/if_lge.c
===================================================================
--- sys/dev/lge/if_lge.c
+++ sys/dev/lge/if_lge.c
@@ -393,7 +393,7 @@
/* now program new ones */
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_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: sys/dev/liquidio/lio_ioctl.c
===================================================================
--- sys/dev/liquidio/lio_ioctl.c
+++ sys/dev/liquidio/lio_ioctl.c
@@ -519,7 +519,7 @@
/* to protect access to if_multiaddrs */
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
*mc = 0;
Index: sys/dev/malo/if_malo.c
===================================================================
--- sys/dev/malo/if_malo.c
+++ sys/dev/malo/if_malo.c
@@ -1539,7 +1539,7 @@
ifp = vap->iv_ifp;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
Index: sys/dev/mge/if_mge.c
===================================================================
--- sys/dev/mge/if_mge.c
+++ sys/dev/mge/if_mge.c
@@ -2052,7 +2052,7 @@
memset(omt, 0, sizeof(omt));
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
Index: sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
===================================================================
--- sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
+++ sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
@@ -623,7 +623,7 @@
mlx4_en_clear_uclist(dev);
if_addr_rlock(dev);
- TAILQ_FOREACH(ifa, &dev->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &dev->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_LINK)
continue;
if (((struct sockaddr_dl *)ifa->ifa_addr)->sdl_alen !=
@@ -661,7 +661,7 @@
mlx4_en_clear_mclist(dev);
if_maddr_rlock(dev);
- TAILQ_FOREACH(ifma, &dev->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &dev->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
if (((struct sockaddr_dl *)ifma->ifma_addr)->sdl_alen !=
Index: sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c
===================================================================
--- sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c
+++ sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c
@@ -29,7 +29,6 @@
#include <linux/list.h>
#include <dev/mlx5/fs.h>
-
#define MLX5_SET_CFG(p, f, v) MLX5_SET(create_flow_group_in, p, f, v)
enum {
@@ -767,7 +766,7 @@
LLADDR((struct sockaddr_dl *)(ifp->if_addr->ifa_addr)));
if_addr_rlock(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_LINK)
continue;
mlx5e_add_eth_addr_to_hash(priv->eth_addr.if_uc,
@@ -776,7 +775,7 @@
if_addr_runlock(ifp);
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
mlx5e_add_eth_addr_to_hash(priv->eth_addr.if_mc,
Index: sys/dev/msk/if_msk.c
===================================================================
--- sys/dev/msk/if_msk.c
+++ sys/dev/msk/if_msk.c
@@ -600,7 +600,7 @@
} else {
mode |= GM_RXCR_UCF_ENA;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_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: sys/dev/mxge/if_mxge.c
===================================================================
--- sys/dev/mxge/if_mxge.c
+++ sys/dev/mxge/if_mxge.c
@@ -1146,7 +1146,7 @@
/* Walk the multicast list, and add each address */
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_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: sys/dev/my/if_my.c
===================================================================
--- sys/dev/my/if_my.c
+++ sys/dev/my/if_my.c
@@ -336,7 +336,7 @@
/* now program new ones */
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_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: sys/dev/nge/if_nge.c
===================================================================
--- sys/dev/nge/if_nge.c
+++ sys/dev/nge/if_nge.c
@@ -727,7 +727,7 @@
* which bit within that byte needs to be set.
*/
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_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: sys/dev/oce/oce_hw.c
===================================================================
--- sys/dev/oce/oce_hw.c
+++ sys/dev/oce/oce_hw.c
@@ -569,7 +569,7 @@
#if __FreeBSD_version > 800000
if_maddr_rlock(ifp);
#endif
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
Index: sys/dev/otus/if_otus.c
===================================================================
--- sys/dev/otus/if_otus.c
+++ sys/dev/otus/if_otus.c
@@ -2330,7 +2330,7 @@
TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
ifp = vap->iv_ifp;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
caddr_t dl;
uint32_t val;
Index: sys/dev/pcn/if_pcn.c
===================================================================
--- sys/dev/pcn/if_pcn.c
+++ sys/dev/pcn/if_pcn.c
@@ -371,7 +371,7 @@
/* now program new ones */
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
h = ether_crc32_le(LLADDR((struct sockaddr_dl *)
Index: sys/dev/qlnx/qlnxe/qlnx_os.c
===================================================================
--- sys/dev/qlnx/qlnxe/qlnx_os.c
+++ sys/dev/qlnx/qlnxe/qlnx_os.c
@@ -2278,7 +2278,7 @@
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
Index: sys/dev/qlxgb/qla_os.c
===================================================================
--- sys/dev/qlxgb/qla_os.c
+++ sys/dev/qlxgb/qla_os.c
@@ -773,7 +773,7 @@
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
Index: sys/dev/qlxgbe/ql_os.c
===================================================================
--- sys/dev/qlxgbe/ql_os.c
+++ sys/dev/qlxgbe/ql_os.c
@@ -988,7 +988,7 @@
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
Index: sys/dev/qlxge/qls_os.c
===================================================================
--- sys/dev/qlxge/qls_os.c
+++ sys/dev/qlxge/qls_os.c
@@ -845,7 +845,7 @@
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
Index: sys/dev/re/if_re.c
===================================================================
--- sys/dev/re/if_re.c
+++ sys/dev/re/if_re.c
@@ -685,7 +685,7 @@
}
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_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: sys/dev/rl/if_rl.c
===================================================================
--- sys/dev/rl/if_rl.c
+++ sys/dev/rl/if_rl.c
@@ -538,7 +538,7 @@
} else {
/* Now program new ones. */
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_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: sys/dev/rtwn/if_rtwn_rx.c
===================================================================
--- sys/dev/rtwn/if_rtwn_rx.c
+++ sys/dev/rtwn/if_rtwn_rx.c
@@ -387,7 +387,7 @@
TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
ifp = vap->iv_ifp;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
caddr_t dl;
uint8_t pos;
Index: sys/dev/sf/if_sf.c
===================================================================
--- sys/dev/sf/if_sf.c
+++ sys/dev/sf/if_sf.c
@@ -484,8 +484,9 @@
/* Now program new ones. */
i = 1;
+ /* XXX how do we maintain reverse semantics without impl */
if_maddr_rlock(ifp);
- TAILQ_FOREACH_REVERSE(ifma, &ifp->if_multiaddrs, ifmultihead,
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs,
ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
Index: sys/dev/sfxge/sfxge_port.c
===================================================================
--- sys/dev/sfxge/sfxge_port.c
+++ sys/dev/sfxge/sfxge_port.c
@@ -369,7 +369,7 @@
port->mcast_count = 0;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family == AF_LINK) {
if (port->mcast_count == EFX_MAC_MULTICAST_LIST_MAX) {
device_printf(sc->dev,
Index: sys/dev/sge/if_sge.c
===================================================================
--- sys/dev/sge/if_sge.c
+++ sys/dev/sge/if_sge.c
@@ -469,7 +469,7 @@
hashes[0] = hashes[1] = 0;
/* Now program new ones. */
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_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: sys/dev/sis/if_sis.c
===================================================================
--- sys/dev/sis/if_sis.c
+++ sys/dev/sis/if_sis.c
@@ -744,7 +744,7 @@
}
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
h = sis_mchash(sc,
@@ -802,7 +802,7 @@
hashes[i] = 0;
i = 0;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
h = sis_mchash(sc,
Index: sys/dev/sk/if_sk.c
===================================================================
--- sys/dev/sk/if_sk.c
+++ sys/dev/sk/if_sk.c
@@ -749,7 +749,8 @@
} else {
i = 1;
if_maddr_rlock(ifp);
- TAILQ_FOREACH_REVERSE(ifma, &ifp->if_multiaddrs, ifmultihead,
+ /* XXX want to maintain reverse semantics */
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs,
ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
@@ -801,7 +802,7 @@
} else {
mode |= YU_RCR_UFLEN;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_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: sys/dev/sn/if_sn.c
===================================================================
--- sys/dev/sn/if_sn.c
+++ sys/dev/sn/if_sn.c
@@ -1418,7 +1418,7 @@
bzero(mcf, MCFSZ);
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK) {
if_maddr_runlock(ifp);
return 0;
Index: sys/dev/ste/if_ste.c
===================================================================
--- sys/dev/ste/if_ste.c
+++ sys/dev/ste/if_ste.c
@@ -434,7 +434,7 @@
rxcfg |= STE_RXMODE_MULTIHASH;
/* Now program new ones. */
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_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: sys/dev/stge/if_stge.c
===================================================================
--- sys/dev/stge/if_stge.c
+++ sys/dev/stge/if_stge.c
@@ -2547,7 +2547,7 @@
count = 0;
if_maddr_rlock(sc->sc_ifp);
- TAILQ_FOREACH(ifma, &sc->sc_ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &sc->sc_ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
crc = ether_crc32_be(LLADDR((struct sockaddr_dl *)
Index: sys/dev/ti/if_ti.c
===================================================================
--- sys/dev/ti/if_ti.c
+++ sys/dev/ti/if_ti.c
@@ -1978,7 +1978,7 @@
/* Now program new ones. */
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_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);
Index: sys/dev/tl/if_tl.c
===================================================================
--- sys/dev/tl/if_tl.c
+++ sys/dev/tl/if_tl.c
@@ -880,7 +880,8 @@
} else {
i = 1;
if_maddr_rlock(ifp);
- TAILQ_FOREACH_REVERSE(ifma, &ifp->if_multiaddrs, ifmultihead, ifma_link) {
+ /* XXX want to maintain reverse semantics - pop list and re-add? */
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
/*
Index: sys/dev/tsec/if_tsec.c
===================================================================
--- sys/dev/tsec/if_tsec.c
+++ sys/dev/tsec/if_tsec.c
@@ -1905,7 +1905,7 @@
}
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
Index: sys/dev/tx/if_tx.c
===================================================================
--- sys/dev/tx/if_tx.c
+++ sys/dev/tx/if_tx.c
@@ -1399,7 +1399,7 @@
filter[3] = 0;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_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: sys/dev/txp/if_txp.c
===================================================================
--- sys/dev/txp/if_txp.c
+++ sys/dev/txp/if_txp.c
@@ -2742,7 +2742,7 @@
mchash[0] = mchash[1] = 0;
mcnt = 0;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_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: sys/dev/usb/net/if_aue.c
===================================================================
--- sys/dev/usb/net/if_aue.c
+++ sys/dev/usb/net/if_aue.c
@@ -555,7 +555,7 @@
/* now program new ones */
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
h = ether_crc32_le(LLADDR((struct sockaddr_dl *)
Index: sys/dev/usb/net/if_axe.c
===================================================================
--- sys/dev/usb/net/if_axe.c
+++ sys/dev/usb/net/if_axe.c
@@ -502,7 +502,7 @@
rxmode &= ~AXE_RXCMD_ALLMULTI;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
{
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
Index: sys/dev/usb/net/if_axge.c
===================================================================
--- sys/dev/usb/net/if_axge.c
+++ sys/dev/usb/net/if_axge.c
@@ -786,7 +786,7 @@
rxmode |= RCR_ACPT_MCAST;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_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: sys/dev/usb/net/if_cue.c
===================================================================
--- sys/dev/usb/net/if_cue.c
+++ sys/dev/usb/net/if_cue.c
@@ -328,7 +328,7 @@
/* now program new ones */
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
{
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
Index: sys/dev/usb/net/if_kue.c
===================================================================
--- sys/dev/usb/net/if_kue.c
+++ sys/dev/usb/net/if_kue.c
@@ -377,7 +377,7 @@
sc->sc_rxfilt &= ~KUE_RXFILT_ALLMULTI;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
{
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
Index: sys/dev/usb/net/if_mos.c
===================================================================
--- sys/dev/usb/net/if_mos.c
+++ sys/dev/usb/net/if_mos.c
@@ -606,7 +606,7 @@
/* get all new ones */
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK) {
allmulti = 1;
continue;
Index: sys/dev/usb/net/if_rue.c
===================================================================
--- sys/dev/usb/net/if_rue.c
+++ sys/dev/usb/net/if_rue.c
@@ -500,7 +500,7 @@
/* now program new ones */
if_maddr_rlock(ifp);
- TAILQ_FOREACH (ifma, &ifp->if_multiaddrs, ifma_link)
+ CK_STAILQ_FOREACH (ifma, &ifp->if_multiaddrs, ifma_link)
{
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
Index: sys/dev/usb/net/if_smsc.c
===================================================================
--- sys/dev/usb/net/if_smsc.c
+++ sys/dev/usb/net/if_smsc.c
@@ -714,14 +714,14 @@
/* Take the lock of the mac address list before hashing each of them */
if_maddr_rlock(ifp);
- if (!TAILQ_EMPTY(&ifp->if_multiaddrs)) {
+ if (!CK_STAILQ_EMPTY(&ifp->if_multiaddrs)) {
/* We are filtering on a set of address so calculate hashes of each
* of the address and set the corresponding bits in the register.
*/
sc->sc_mac_csr |= SMSC_MAC_CSR_HPFILT;
sc->sc_mac_csr &= ~(SMSC_MAC_CSR_PRMS | SMSC_MAC_CSR_MCPAS);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
Index: sys/dev/usb/net/if_udav.c
===================================================================
--- sys/dev/usb/net/if_udav.c
+++ sys/dev/usb/net/if_udav.c
@@ -522,7 +522,7 @@
/* now program new ones */
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
{
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
Index: sys/dev/usb/net/if_ure.c
===================================================================
--- sys/dev/usb/net/if_ure.c
+++ sys/dev/usb/net/if_ure.c
@@ -795,7 +795,7 @@
rxmode |= URE_RCR_AM;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_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: sys/dev/usb/wlan/if_rsu.c
===================================================================
--- sys/dev/usb/wlan/if_rsu.c
+++ sys/dev/usb/wlan/if_rsu.c
@@ -885,7 +885,7 @@
TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
ifp = vap->iv_ifp;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
caddr_t dl;
uint8_t pos;
Index: sys/dev/usb/wlan/if_zyd.c
===================================================================
--- sys/dev/usb/wlan/if_zyd.c
+++ sys/dev/usb/wlan/if_zyd.c
@@ -2000,7 +2000,7 @@
TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
ifp = vap->iv_ifp;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
v = ((uint8_t *)LLADDR((struct sockaddr_dl *)
Index: sys/dev/vge/if_vge.c
===================================================================
--- sys/dev/vge/if_vge.c
+++ sys/dev/vge/if_vge.c
@@ -574,7 +574,7 @@
vge_cam_clear(sc);
/* Now program new ones */
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
error = vge_cam_set(sc,
@@ -587,7 +587,7 @@
if (error) {
vge_cam_clear(sc);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_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: sys/dev/virtio/network/if_vtnet.c
===================================================================
--- sys/dev/virtio/network/if_vtnet.c
+++ sys/dev/virtio/network/if_vtnet.c
@@ -81,7 +81,6 @@
#include <dev/virtio/virtqueue.h>
#include <dev/virtio/network/virtio_net.h>
#include <dev/virtio/network/if_vtnetvar.h>
-
#include "virtio_if.h"
#include "opt_inet.h"
@@ -3321,7 +3320,7 @@
/* Unicast MAC addresses: */
if_addr_rlock(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_LINK)
continue;
else if (memcmp(LLADDR((struct sockaddr_dl *)ifa->ifa_addr),
@@ -3348,7 +3347,7 @@
/* Multicast MAC addresses: */
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
else if (mcnt == VTNET_MAX_MAC_ENTRIES) {
Index: sys/dev/vmware/vmxnet3/if_vmx.c
===================================================================
--- sys/dev/vmware/vmxnet3/if_vmx.c
+++ sys/dev/vmware/vmxnet3/if_vmx.c
@@ -3173,7 +3173,7 @@
int cnt = 0, overflow = 0;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
else if (cnt == VMXNET3_MULTICAST_MAX) {
Index: sys/dev/vr/if_vr.c
===================================================================
--- sys/dev/vr/if_vr.c
+++ sys/dev/vr/if_vr.c
@@ -474,7 +474,7 @@
* 32 entries multicast perfect filter.
*/
cam_mask = 0;
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
error = vr_cam_data(sc, VR_MCAST_CAM, mcnt,
@@ -496,7 +496,7 @@
* table based filtering.
*/
mcnt = 0;
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_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: sys/dev/vte/if_vte.c
===================================================================
--- sys/dev/vte/if_vte.c
+++ sys/dev/vte/if_vte.c
@@ -1996,7 +1996,7 @@
nperf = 0;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &sc->vte_ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &sc->vte_ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
/*
Index: sys/dev/wb/if_wb.c
===================================================================
--- sys/dev/wb/if_wb.c
+++ sys/dev/wb/if_wb.c
@@ -440,7 +440,7 @@
/* now program new ones */
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_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: sys/dev/wi/if_wi.c
===================================================================
--- sys/dev/wi/if_wi.c
+++ sys/dev/wi/if_wi.c
@@ -1528,7 +1528,7 @@
ifp = vap->iv_ifp;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
if (n >= 16)
Index: sys/dev/xe/if_xe.c
===================================================================
--- sys/dev/xe/if_xe.c
+++ sys/dev/xe/if_xe.c
@@ -1394,7 +1394,7 @@
/* Iterate over multicast address list */
count = 0;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(maddr, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(maddr, &ifp->if_multiaddrs, ifma_link) {
if (maddr->ifma_addr->sa_family != AF_LINK)
continue;
Index: sys/dev/xen/netfront/netfront.c
===================================================================
--- sys/dev/xen/netfront/netfront.c
+++ sys/dev/xen/netfront/netfront.c
@@ -944,7 +944,7 @@
struct ifaddr *ifa;
ifp = info->xn_ifp;
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family == AF_INET) {
arp_ifinit(ifp, ifa);
}
Index: sys/dev/xl/if_xl.c
===================================================================
--- sys/dev/xl/if_xl.c
+++ sys/dev/xl/if_xl.c
@@ -636,7 +636,7 @@
rxfilt |= XL_RXFILTER_ALLMULTI;
} else {
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
rxfilt |= XL_RXFILTER_ALLMULTI;
@@ -691,7 +691,7 @@
/* Now program new ones. */
mcnt = 0;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
/*
Index: sys/kern/subr_witness.c
===================================================================
--- sys/kern/subr_witness.c
+++ sys/kern/subr_witness.c
@@ -537,7 +537,7 @@
{ "in_multi_list_mtx", &lock_class_mtx_sleep },
{ "igmp_mtx", &lock_class_mtx_sleep },
{ "ifnet_rw", &lock_class_rw },
- { "if_addr_lock", &lock_class_rw },
+ { "if_addr_lock", &lock_class_mtx_sleep },
{ NULL, NULL },
/*
* IPv6 multicast:
@@ -548,7 +548,7 @@
{ "in6_multi_list_mtx", &lock_class_mtx_sleep },
{ "mld_mtx", &lock_class_mtx_sleep },
{ "ifnet_rw", &lock_class_rw },
- { "if_addr_lock", &lock_class_rw },
+ { "if_addr_lock", &lock_class_mtx_sleep },
{ NULL, NULL },
/*
* UNIX Domain Sockets
Index: sys/net/if.c
===================================================================
--- sys/net/if.c
+++ sys/net/if.c
@@ -560,8 +560,8 @@
TASK_INIT(&ifp->if_linktask, 0, do_link_state_change, ifp);
ifp->if_afdata_initialized = 0;
IF_AFDATA_LOCK_INIT(ifp);
- TAILQ_INIT(&ifp->if_addrhead);
- TAILQ_INIT(&ifp->if_multiaddrs);
+ CK_STAILQ_INIT(&ifp->if_addrhead);
+ CK_STAILQ_INIT(&ifp->if_multiaddrs);
TAILQ_INIT(&ifp->if_groups);
#ifdef MAC
mac_ifnet_init(ifp);
@@ -830,7 +830,7 @@
sdl->sdl_len = masklen;
while (namelen != 0)
sdl->sdl_data[--namelen] = 0xff;
- TAILQ_INSERT_HEAD(&ifp->if_addrhead, ifa, ifa_link);
+ CK_STAILQ_INSERT_HEAD(&ifp->if_addrhead, ifa, ifa_link);
/* Reliably crash if used uninitialized. */
ifp->if_broadcastaddr = NULL;
@@ -872,7 +872,7 @@
* of the interface.
*/
for (ifa = ifp->if_addr; ifa != NULL;
- ifa = TAILQ_NEXT(ifa, ifa_link)) {
+ ifa = CK_STAILQ_NEXT(ifa, ifa_link)) {
if (ifa->ifa_addr->sa_family == AF_LINK) {
sdl = (struct sockaddr_dl *)ifa->ifa_addr;
sdl->sdl_index = ifp->if_index;
@@ -948,7 +948,7 @@
struct ifaddr *ifa, *next;
/* XXX cannot hold IF_ADDR_WLOCK over called functions. */
- TAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, next) {
+ CK_STAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, next) {
if (ifa->ifa_addr->sa_family == AF_LINK)
continue;
#ifdef INET
@@ -973,7 +973,9 @@
}
#endif /* INET6 */
IF_ADDR_WLOCK(ifp);
- TAILQ_REMOVE(&ifp->if_addrhead, ifa, ifa_link);
+ CK_STAILQ_REMOVE(&ifp->if_addrhead, ifa, ifaddr, ifa_link);
+ /* mark as unlinked */
+ ifa->ifa_addr->sa_family = AF_UNSPEC;
IF_ADDR_WUNLOCK(ifp);
ifa_free(ifa);
}
@@ -989,9 +991,11 @@
struct ifmultiaddr *ifma;
IF_ADDR_WLOCK(ifp);
- while (!TAILQ_EMPTY(&ifp->if_multiaddrs)) {
- ifma = TAILQ_FIRST(&ifp->if_multiaddrs);
- TAILQ_REMOVE(&ifp->if_multiaddrs, ifma, ifma_link);
+ while (!CK_STAILQ_EMPTY(&ifp->if_multiaddrs)) {
+ ifma = CK_STAILQ_FIRST(&ifp->if_multiaddrs);
+ CK_STAILQ_REMOVE(&ifp->if_multiaddrs, ifma, ifmultiaddr, ifma_link);
+ /* mark as unlinked */
+ ifma->ifma_addr->sa_family = AF_UNSPEC;
if_delmulti_locked(ifp, ifma, 1);
}
IF_ADDR_WUNLOCK(ifp);
@@ -1163,9 +1167,11 @@
/* We can now free link ifaddr. */
IF_ADDR_WLOCK(ifp);
- if (!TAILQ_EMPTY(&ifp->if_addrhead)) {
- ifa = TAILQ_FIRST(&ifp->if_addrhead);
- TAILQ_REMOVE(&ifp->if_addrhead, ifa, ifa_link);
+ if (!CK_STAILQ_EMPTY(&ifp->if_addrhead)) {
+ ifa = CK_STAILQ_FIRST(&ifp->if_addrhead);
+ CK_STAILQ_REMOVE(&ifp->if_addrhead, ifa, ifaddr, ifa_link);
+ /* mark as unlinked */
+ ifa->ifa_addr->sa_family = AF_UNSPEC;
IF_ADDR_WUNLOCK(ifp);
ifa_free(ifa);
} else
@@ -1798,17 +1804,39 @@
refcount_acquire(&ifa->ifa_refcnt);
}
+static void
+ifa_free_internal(struct ifaddr *ifa)
+{
+ counter_u64_t op, ip, ob, ib;
+
+ op = ifa->ifa_opackets;
+ ip = ifa->ifa_ipackets;
+ ob = ifa->ifa_obytes;
+ ib = ifa->ifa_ibytes;
+
+ free(ifa, M_IFADDR);
+
+ counter_u64_free(op);
+ counter_u64_free(ip);
+ counter_u64_free(ob);
+ counter_u64_free(ib);
+}
+
+static void
+ifa_destroy(epoch_context_t ctx)
+{
+ struct ifaddr *ifa;
+
+ ifa = __containerof(ctx, struct ifaddr, ifa_epoch_ctx);
+ ifa_free_internal(ifa);
+}
+
void
ifa_free(struct ifaddr *ifa)
{
- if (refcount_release(&ifa->ifa_refcnt)) {
- counter_u64_free(ifa->ifa_opackets);
- counter_u64_free(ifa->ifa_ipackets);
- counter_u64_free(ifa->ifa_obytes);
- counter_u64_free(ifa->ifa_ibytes);
- free(ifa, M_IFADDR);
- }
+ if (refcount_release(&ifa->ifa_refcnt))
+ epoch_call(net_epoch, &ifa->ifa_epoch_ctx, ifa_destroy);
}
static int
@@ -1887,7 +1915,7 @@
IFNET_RLOCK_NOSLEEP();
TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != addr->sa_family)
continue;
if (sa_equal(addr, ifa->ifa_addr)) {
@@ -1944,7 +1972,7 @@
if ((fibnum != RT_ALL_FIBS) && (ifp->if_fib != fibnum))
continue;
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != addr->sa_family)
continue;
if ((ifp->if_flags & IFF_BROADCAST) &&
@@ -1981,7 +2009,7 @@
if ((fibnum != RT_ALL_FIBS) && (ifp->if_fib != fibnum))
continue;
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != addr->sa_family)
continue;
if (ifa->ifa_dstaddr != NULL &&
@@ -2033,7 +2061,7 @@
if ((fibnum != RT_ALL_FIBS) && (ifp->if_fib != fibnum))
continue;
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
const char *cp, *cp2, *cp3;
if (ifa->ifa_addr->sa_family != af)
@@ -2118,7 +2146,7 @@
if (af >= AF_MAX)
return (NULL);
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != af)
continue;
if (ifa_maybe == NULL)
@@ -2240,7 +2268,7 @@
ifp->if_flags &= ~flag;
getmicrotime(&ifp->if_lastchange);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
if (fam == PF_UNSPEC || (fam == ifa->ifa_addr->sa_family))
pfctlinput(PRC_IFDOWN, ifa->ifa_addr);
ifp->if_qflush(ifp);
@@ -2263,7 +2291,7 @@
ifp->if_flags |= flag;
getmicrotime(&ifp->if_lastchange);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
if (fam == PF_UNSPEC || (fam == ifa->ifa_addr->sa_family))
pfctlinput(PRC_IFUP, ifa->ifa_addr);
if (ifp->if_carp)
@@ -3255,7 +3283,7 @@
addrs = 0;
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
struct sockaddr *sa = ifa->ifa_addr;
if (prison_if(curthread->td_ucred, sa) != 0)
@@ -3327,7 +3355,7 @@
IF_ADDR_LOCK_ASSERT(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (sa->sa_family == AF_LINK) {
if (sa_dl_equal(ifma->ifma_addr, sa))
break;
@@ -3397,8 +3425,8 @@
#ifdef MCAST_VERBOSE
extern void kdb_backtrace(void);
#endif
-void
-if_freemulti(struct ifmultiaddr *ifma)
+static void
+if_freemulti_internal(struct ifmultiaddr *ifma)
{
KASSERT(ifma->ifma_refcount == 0, ("if_freemulti: refcount %d",
@@ -3414,6 +3442,23 @@
free(ifma, M_IFMADDR);
}
+static void
+if_destroymulti(epoch_context_t ctx)
+{
+ struct ifmultiaddr *ifma;
+
+ ifma = __containerof(ctx, struct ifmultiaddr, ifma_epoch_ctx);
+ if_freemulti_internal(ifma);
+}
+
+void
+if_freemulti(struct ifmultiaddr *ifma)
+{
+ KASSERT(ifma->ifma_refcount == 0, ("if_freemulti_epoch: refcount %d",
+ ifma->ifma_refcount));
+
+ epoch_call(net_epoch, &ifma->ifma_epoch_ctx, if_destroymulti);
+}
/*
* Register an additional multicast address with a network interface.
*
@@ -3507,7 +3552,7 @@
error = ENOMEM;
goto free_llsa_out;
}
- TAILQ_INSERT_HEAD(&ifp->if_multiaddrs, ll_ifma,
+ CK_STAILQ_INSERT_HEAD(&ifp->if_multiaddrs, ll_ifma,
ifma_link);
} else
ll_ifma->ifma_refcount++;
@@ -3519,7 +3564,7 @@
* referenced link layer address. Add the primary address to the
* ifnet address list.
*/
- TAILQ_INSERT_HEAD(&ifp->if_multiaddrs, ifma, ifma_link);
+ CK_STAILQ_INSERT_HEAD(&ifp->if_multiaddrs, ifma, ifma_link);
if (retifma != NULL)
*retifma = ifma;
@@ -3611,7 +3656,7 @@
struct ifmultiaddr *next;
IF_ADDR_WLOCK(ifp);
- TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next)
+ CK_STAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next)
if_delmulti_locked(ifp, ifma, 0);
IF_ADDR_WUNLOCK(ifp);
}
@@ -3721,9 +3766,11 @@
if (--ifma->ifma_refcount > 0)
return 0;
- if (ifp != NULL && detaching == 0)
- TAILQ_REMOVE(&ifp->if_multiaddrs, ifma, ifma_link);
-
+ if (ifp != NULL && detaching == 0) {
+ CK_STAILQ_REMOVE(&ifp->if_multiaddrs, ifma, ifmultiaddr, ifma_link);
+ /* mark as unlinked */
+ ifma->ifma_addr->sa_family = AF_UNSPEC;
+ }
/*
* If this ifma is a network-layer ifma, a link-layer ifma may
* have been associated with it. Release it first if so.
@@ -3736,8 +3783,11 @@
ll_ifma->ifma_ifp = NULL; /* XXX */
if (--ll_ifma->ifma_refcount == 0) {
if (ifp != NULL) {
- TAILQ_REMOVE(&ifp->if_multiaddrs, ll_ifma,
+ CK_STAILQ_REMOVE(&ifp->if_multiaddrs, ll_ifma, ifmultiaddr,
ifma_link);
+ /* mark as unlinked */
+ ll_ifma->ifma_addr->sa_family = AF_UNSPEC;
+
}
if_freemulti(ll_ifma);
}
@@ -3746,7 +3796,7 @@
if (ifp) {
struct ifmultiaddr *ifmatmp;
- TAILQ_FOREACH(ifmatmp, &ifp->if_multiaddrs, ifma_link)
+ CK_STAILQ_FOREACH(ifmatmp, &ifp->if_multiaddrs, ifma_link)
MPASS(ifma != ifmatmp);
}
#endif
@@ -4275,7 +4325,7 @@
uint8_t *lmta = (uint8_t *)mta;
int mcnt = 0;
- TAILQ_FOREACH(ifma, &((struct ifnet *)ifp)->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &((struct ifnet *)ifp)->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
@@ -4310,7 +4360,7 @@
count = 0;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &((struct ifnet *)ifp)->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &((struct ifnet *)ifp)->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
count++;
@@ -4328,7 +4378,7 @@
int cnt = 0;
if_maddr_rlock(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
cnt += filter(arg, ifma, cnt);
if_maddr_runlock(ifp);
return (cnt);
Index: sys/net/if_lagg.c
===================================================================
--- sys/net/if_lagg.c
+++ sys/net/if_lagg.c
@@ -1525,7 +1525,7 @@
LAGG_WLOCK_ASSERT(sc);
IF_ADDR_WLOCK(scifp);
- TAILQ_FOREACH(ifma, &scifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &scifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
mc = malloc(sizeof(struct lagg_mc), M_DEVBUF, M_NOWAIT);
Index: sys/net/if_spppsubr.c
===================================================================
--- sys/net/if_spppsubr.c
+++ sys/net/if_spppsubr.c
@@ -4837,7 +4837,7 @@
*/
si = NULL;
if_addr_rlock(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
if (ifa->ifa_addr->sa_family == AF_INET) {
si = (struct sockaddr_in *)ifa->ifa_addr;
sm = (struct sockaddr_in *)ifa->ifa_netmask;
@@ -4879,7 +4879,7 @@
*/
si = NULL;
if_addr_rlock(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family == AF_INET) {
si = (struct sockaddr_in *)ifa->ifa_addr;
if (si != NULL) {
@@ -4941,7 +4941,7 @@
*/
si = NULL;
if_addr_rlock(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
if (ifa->ifa_addr->sa_family == AF_INET6) {
si = (struct sockaddr_in6 *)ifa->ifa_addr;
sm = (struct sockaddr_in6 *)ifa->ifa_netmask;
@@ -4996,7 +4996,7 @@
sin6 = NULL;
if_addr_rlock(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family == AF_INET6) {
sin6 = (struct sockaddr_in6 *)ifa->ifa_addr;
if (sin6 && IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
Index: sys/net/if_stf.c
===================================================================
--- sys/net/if_stf.c
+++ sys/net/if_stf.c
@@ -380,7 +380,7 @@
struct in_addr in;
if_addr_rlock(ifp);
- TAILQ_FOREACH(ia, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ia, &ifp->if_addrhead, ifa_link) {
if (ia->ifa_addr->sa_family != AF_INET6)
continue;
sin6 = (struct sockaddr_in6 *)ia->ifa_addr;
@@ -557,7 +557,7 @@
* reject packets with broadcast
*/
IN_IFADDR_RLOCK(&in_ifa_tracker);
- TAILQ_FOREACH(ia4, &V_in_ifaddrhead, ia_link) {
+ CK_STAILQ_FOREACH(ia4, &V_in_ifaddrhead, ia_link) {
if ((ia4->ia_ifa.ifa_ifp->if_flags & IFF_BROADCAST) == 0)
continue;
if (in->s_addr == ia4->ia_broadaddr.sin_addr.s_addr) {
Index: sys/net/if_tap.c
===================================================================
--- sys/net/if_tap.c
+++ sys/net/if_tap.c
@@ -77,7 +77,6 @@
#include <net/if_tapvar.h>
#include <net/if_tap.h>
-
#define CDEV_NAME "tap"
#define TAPDEBUG if (tapdebug) printf
@@ -544,7 +543,7 @@
if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
mtx_unlock(&tp->tap_mtx);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
rtinit(ifa, (int)RTM_DELETE, 0);
}
if_purgeaddrs(ifp);
Index: sys/net/if_tun.c
===================================================================
--- sys/net/if_tun.c
+++ sys/net/if_tun.c
@@ -466,7 +466,7 @@
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
mtx_unlock(&tp->tun_mtx);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
/* deal w/IPv4 PtP destination; unlocked read */
if (ifa->ifa_addr->sa_family == AF_INET) {
rtinit(ifa, (int)RTM_DELETE,
@@ -508,7 +508,7 @@
#ifdef INET
if_addr_rlock(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family == AF_INET) {
struct sockaddr_in *si;
Index: sys/net/if_var.h
===================================================================
--- sys/net/if_var.h
+++ sys/net/if_var.h
@@ -91,8 +91,13 @@
#include <net/altq/if_altq.h>
TAILQ_HEAD(ifnethead, ifnet); /* we use TAILQs so that the order of */
+#ifdef _KERNEL
+CK_STAILQ_HEAD(ifmultihead, ifmultiaddr);
+CK_STAILQ_HEAD(ifaddrhead, ifaddr); /* instantiation is preserved in the list */
+#else
TAILQ_HEAD(ifaddrhead, ifaddr); /* instantiation is preserved in the list */
TAILQ_HEAD(ifmultihead, ifmultiaddr);
+#endif
TAILQ_HEAD(ifgrouphead, ifg_group);
#ifdef _KERNEL
@@ -280,7 +285,7 @@
struct task if_linktask; /* task for link change events */
/* Addresses of different protocol families assigned to this if. */
- struct rwlock if_addr_lock; /* lock to protect address lists */
+ struct mtx if_addr_lock; /* lock to protect address lists */
/*
* if_addrhead is the list of all addresses associated to
* an interface.
@@ -391,14 +396,15 @@
/*
* Locks for address lists on the network interface.
*/
-#define IF_ADDR_LOCK_INIT(if) rw_init(&(if)->if_addr_lock, "if_addr_lock")
-#define IF_ADDR_LOCK_DESTROY(if) rw_destroy(&(if)->if_addr_lock)
-#define IF_ADDR_WLOCK(if) rw_wlock(&(if)->if_addr_lock)
-#define IF_ADDR_WUNLOCK(if) rw_wunlock(&(if)->if_addr_lock)
-#define IF_ADDR_RLOCK(if) rw_rlock(&(if)->if_addr_lock)
-#define IF_ADDR_RUNLOCK(if) rw_runlock(&(if)->if_addr_lock)
-#define IF_ADDR_LOCK_ASSERT(if) rw_assert(&(if)->if_addr_lock, RA_LOCKED)
-#define IF_ADDR_WLOCK_ASSERT(if) rw_assert(&(if)->if_addr_lock, RA_WLOCKED)
+#define IF_ADDR_LOCK_INIT(if) mtx_init(&(if)->if_addr_lock, "if_addr_lock", NULL, MTX_DEF)
+#define IF_ADDR_LOCK_DESTROY(if) mtx_destroy(&(if)->if_addr_lock)
+#define IF_ADDR_RLOCK(if) epoch_enter(net_epoch);
+#define IF_ADDR_RUNLOCK(if) epoch_exit(net_epoch);
+
+#define IF_ADDR_WLOCK(if) mtx_lock(&(if)->if_addr_lock)
+#define IF_ADDR_WUNLOCK(if) mtx_unlock(&(if)->if_addr_lock)
+#define IF_ADDR_LOCK_ASSERT(if) MPASS(in_epoch() || mtx_owned(&(if)->if_addr_lock))
+#define IF_ADDR_WLOCK_ASSERT(if) mtx_assert(&(if)->if_addr_lock, MA_OWNED)
/*
* Function variations on locking macros intended to be used by loadable
@@ -512,7 +518,7 @@
struct sockaddr *ifa_netmask; /* used to determine subnet */
struct ifnet *ifa_ifp; /* back-pointer to interface */
struct carp_softc *ifa_carp; /* pointer to CARP data */
- TAILQ_ENTRY(ifaddr) ifa_link; /* queue macro glue */
+ STAILQ_ENTRY(ifaddr) ifa_link; /* queue macro glue */
void (*ifa_rtrequest) /* check or clean routes (+ or -)'d */
(int, struct rtentry *, struct rt_addrinfo *);
u_short ifa_flags; /* mostly rt_flags for cloning */
@@ -524,6 +530,7 @@
counter_u64_t ifa_opackets;
counter_u64_t ifa_ibytes;
counter_u64_t ifa_obytes;
+ struct epoch_context ifa_epoch_ctx;
};
struct ifaddr * ifa_alloc(size_t size, int flags);
@@ -535,13 +542,14 @@
* structure except that it keeps track of multicast addresses.
*/
struct ifmultiaddr {
- TAILQ_ENTRY(ifmultiaddr) ifma_link; /* queue macro glue */
+ STAILQ_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 */
u_int ifma_refcount; /* reference count */
void *ifma_protospec; /* protocol-specific state, if any */
struct ifmultiaddr *ifma_llifma; /* pointer to ifma for ifma_lladdr */
+ struct epoch_context ifma_epoch_ctx;
};
extern struct rwlock ifnet_rwlock;
Index: sys/net/if_vlan.c
===================================================================
--- sys/net/if_vlan.c
+++ sys/net/if_vlan.c
@@ -609,7 +609,7 @@
/* Now program new ones. */
IF_ADDR_WLOCK(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
mc = malloc(sizeof(struct vlan_mc_entry), M_VLAN, M_NOWAIT);
Index: sys/net/rtsock.c
===================================================================
--- sys/net/rtsock.c
+++ sys/net/rtsock.c
@@ -458,7 +458,7 @@
* that belongs to the jail.
*/
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
struct sockaddr *sa;
sa = ifa->ifa_addr;
if (sa->sa_family != AF_INET)
@@ -500,7 +500,7 @@
* that belongs to the jail.
*/
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
struct sockaddr *sa;
sa = ifa->ifa_addr;
if (sa->sa_family != AF_INET6)
@@ -1757,7 +1757,7 @@
if (error)
goto done;
}
- while ((ifa = TAILQ_NEXT(ifa, ifa_link)) != NULL) {
+ while ((ifa = CK_STAILQ_NEXT(ifa, ifa_link)) != NULL) {
if (af && af != ifa->ifa_addr->sa_family)
continue;
if (prison_if(w->w_req->td->td_ucred,
@@ -1812,7 +1812,7 @@
ifa = ifp->if_addr;
info.rti_info[RTAX_IFP] = ifa ? ifa->ifa_addr : NULL;
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (af && af != ifma->ifma_addr->sa_family)
continue;
if (prison_if(w->w_req->td->td_ucred,
Index: sys/netgraph/ng_eiface.c
===================================================================
--- sys/netgraph/ng_eiface.c
+++ sys/netgraph/ng_eiface.c
@@ -60,6 +60,7 @@
#include <net/ethernet.h>
#include <net/if_arp.h>
+
static const struct ng_cmdlist ng_eiface_cmdlist[] = {
{
NGM_EIFACE_COOKIE,
@@ -512,7 +513,7 @@
/* Determine size of response and allocate it */
buflen = 0;
if_addr_rlock(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
buflen += SA_SIZE(ifa->ifa_addr);
NG_MKRESPONSE(resp, msg, buflen, M_NOWAIT);
if (resp == NULL) {
@@ -523,7 +524,7 @@
/* Add addresses */
ptr = resp->data;
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
const int len = SA_SIZE(ifa->ifa_addr);
if (buflen < len) {
Index: sys/netinet/if_ether.c
===================================================================
--- sys/netinet/if_ether.c
+++ sys/netinet/if_ether.c
@@ -362,7 +362,7 @@
struct ifaddr *ifa;
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET)
continue;
@@ -886,7 +886,7 @@
* as a dummy address for the rest of the function.
*/
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
if (ifa->ifa_addr->sa_family == AF_INET &&
(ifa->ifa_carp == NULL ||
(*carp_iamatch_p)(ifa, &enaddr))) {
@@ -901,7 +901,7 @@
* If bridging, fall back to using any inet address.
*/
IN_IFADDR_RLOCK(&in_ifa_tracker);
- if (!bridged || (ia = TAILQ_FIRST(&V_in_ifaddrhead)) == NULL) {
+ if (!bridged || (ia = CK_STAILQ_FIRST(&V_in_ifaddrhead)) == NULL) {
IN_IFADDR_RUNLOCK(&in_ifa_tracker);
goto drop;
}
@@ -1445,7 +1445,7 @@
{
struct ifaddr *ifa;
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family == AF_INET)
arp_ifinit(ifp, ifa);
}
Index: sys/netinet/igmp.c
===================================================================
--- sys/netinet/igmp.c
+++ sys/netinet/igmp.c
@@ -623,7 +623,7 @@
if (igi->igi_version == IGMP_VERSION_3) {
IF_ADDR_WLOCK(ifp);
restart:
- TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) {
+ CK_STAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) {
if (ifma->ifma_addr->sa_family != AF_INET ||
ifma->ifma_protospec == NULL)
continue;
@@ -734,7 +734,7 @@
* except those which are already running.
*/
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_INET ||
ifma->ifma_protospec == NULL)
continue;
@@ -835,7 +835,7 @@
CTR2(KTR_IGMPV3, "process v2 general query on ifp %p(%s)",
ifp, ifp->if_xname);
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_INET ||
ifma->ifma_protospec == NULL)
continue;
@@ -1698,7 +1698,7 @@
IF_ADDR_WLOCK(ifp);
restart:
- TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) {
+ CK_STAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) {
if (ifma->ifma_addr->sa_family != AF_INET ||
ifma->ifma_protospec == NULL)
continue;
@@ -2012,7 +2012,7 @@
*/
ifp = igi->igi_ifp;
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_INET ||
ifma->ifma_protospec == NULL)
continue;
@@ -3323,7 +3323,7 @@
ifp = igi->igi_ifp;
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_INET ||
ifma->ifma_protospec == NULL)
continue;
Index: sys/netinet/in.c
===================================================================
--- sys/netinet/in.c
+++ sys/netinet/in.c
@@ -102,7 +102,7 @@
struct in_ifaddr *ia;
IN_IFADDR_RLOCK(&in_ifa_tracker);
- TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) {
+ CK_STAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) {
if ((i & ia->ia_subnetmask) == ia->ia_subnet) {
IN_IFADDR_RUNLOCK(&in_ifa_tracker);
return (1);
@@ -143,7 +143,7 @@
struct in_ifaddr *ia;
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET)
continue;
ia = (struct in_ifaddr *)ifa;
@@ -278,7 +278,7 @@
* first one on the interface, if possible.
*/
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET)
continue;
ia = (struct in_ifaddr *)ifa;
@@ -286,7 +286,7 @@
break;
}
if (ifa == NULL)
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
if (ifa->ifa_addr->sa_family == AF_INET) {
ia = (struct in_ifaddr *)ifa;
if (prison_check_ip4(td->td_ucred,
@@ -377,7 +377,7 @@
iaIsFirst = true;
ia = NULL;
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
struct in_ifaddr *it;
if (ifa->ifa_addr->sa_family != AF_INET)
@@ -455,12 +455,12 @@
/* if_addrhead is already referenced by ifa_alloc() */
IF_ADDR_WLOCK(ifp);
- TAILQ_INSERT_TAIL(&ifp->if_addrhead, ifa, ifa_link);
+ CK_STAILQ_INSERT_TAIL(&ifp->if_addrhead, ifa, ifa_link);
IF_ADDR_WUNLOCK(ifp);
ifa_ref(ifa); /* in_ifaddrhead */
IN_IFADDR_WLOCK();
- TAILQ_INSERT_TAIL(&V_in_ifaddrhead, ia, ia_link);
+ CK_STAILQ_INSERT_TAIL(&V_in_ifaddrhead, ia, ia_link);
LIST_INSERT_HEAD(INADDR_HASH(ia->ia_addr.sin_addr.s_addr), ia, ia_hash);
IN_IFADDR_WUNLOCK();
@@ -533,13 +533,17 @@
(*carp_detach_p)(&ia->ia_ifa, false);
IF_ADDR_WLOCK(ifp);
- TAILQ_REMOVE(&ifp->if_addrhead, &ia->ia_ifa, ifa_link);
+ CK_STAILQ_REMOVE(&ifp->if_addrhead, &ia->ia_ifa, ifaddr, ifa_link);
+ /* mark as unlinked */
+ ia->ia_ifa.ifa_addr->sa_family = AF_UNSPEC;
IF_ADDR_WUNLOCK(ifp);
ifa_free(&ia->ia_ifa); /* if_addrhead */
IN_IFADDR_WLOCK();
- TAILQ_REMOVE(&V_in_ifaddrhead, ia, ia_link);
+ CK_STAILQ_REMOVE(&V_in_ifaddrhead, ia, in_ifaddr, ia_link);
LIST_REMOVE(ia, ia_hash);
+ /* mark as unlinked */
+ ia->ia_ifa.ifa_addr->sa_family = AF_UNSPEC;
IN_IFADDR_WUNLOCK();
ifa_free(&ia->ia_ifa); /* in_ifaddrhead */
@@ -572,7 +576,7 @@
iaIsLast = true;
ia = NULL;
IF_ADDR_WLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
struct in_ifaddr *it;
if (ifa->ifa_addr->sa_family != AF_INET)
@@ -597,12 +601,12 @@
return (EADDRNOTAVAIL);
}
- TAILQ_REMOVE(&ifp->if_addrhead, &ia->ia_ifa, ifa_link);
+ CK_STAILQ_REMOVE(&ifp->if_addrhead, &ia->ia_ifa, ifaddr, ifa_link);
IF_ADDR_WUNLOCK(ifp);
ifa_free(&ia->ia_ifa); /* if_addrhead */
IN_IFADDR_WLOCK();
- TAILQ_REMOVE(&V_in_ifaddrhead, ia, ia_link);
+ CK_STAILQ_REMOVE(&V_in_ifaddrhead, ia, in_ifaddr, ia_link);
LIST_REMOVE(ia, ia_hash);
IN_IFADDR_WUNLOCK();
@@ -645,6 +649,9 @@
IF_ADDR_WUNLOCK(ifp);
EVENTHANDLER_INVOKE(ifaddr_event, ifp);
+
+ /* mark as unlinked */
+ ia->ia_ifa.ifa_addr->sa_family = AF_UNSPEC;
ifa_free(&ia->ia_ifa); /* in_ifaddrhead */
return (0);
@@ -676,7 +683,7 @@
IN_IFADDR_RLOCK(&in_ifa_tracker);
/* Look for an existing address with the same prefix, mask, and fib */
- TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) {
+ CK_STAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) {
if (rtinitflags(ia)) {
p = ia->ia_dstaddr.sin_addr;
@@ -836,7 +843,7 @@
}
IN_IFADDR_RLOCK(&in_ifa_tracker);
- TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) {
+ CK_STAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) {
if (rtinitflags(ia)) {
p = ia->ia_dstaddr.sin_addr;
@@ -915,7 +922,7 @@
TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
/* Cannot lock here - lock recursion. */
/* IF_ADDR_RLOCK(ifp); */
- TAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, nifa) {
+ CK_STAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, nifa) {
if (ifa->ifa_addr->sa_family != AF_INET)
continue;
@@ -976,7 +983,7 @@
* with a broadcast address.
*/
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
if (ifa->ifa_addr->sa_family == AF_INET &&
in_ifaddr_broadcast(in, (struct in_ifaddr *)ifa)) {
found = 1;
@@ -1025,7 +1032,7 @@
*/
IF_ADDR_WLOCK(ifp);
restart:
- TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) {
+ CK_STAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) {
if (ifma->ifma_addr->sa_family != AF_INET ||
ifma->ifma_protospec == NULL)
continue;
Index: sys/netinet/in_debug.c
===================================================================
--- sys/netinet/in_debug.c
+++ sys/netinet/in_debug.c
@@ -93,9 +93,7 @@
IA_DB_RPINTF("%p", ia_hash.le_next);
IA_DB_RPINTF("%p", ia_hash.le_prev);
IA_DB_RPINTF_DPTR("%p", ia_hash.le_prev);
- IA_DB_RPINTF("%p", ia_link.tqe_next);
- IA_DB_RPINTF("%p", ia_link.tqe_prev);
- IA_DB_RPINTF_DPTR("%p", ia_link.tqe_prev);
+ IA_DB_RPINTF("%p", ia_link.stqe_next);
IA_DB_RPINTF_PTR("%p", ia_addr);
IA_DB_RPINTF_PTR("%p", ia_dstaddr);
IA_DB_RPINTF_PTR("%p", ia_sockmask);
Index: sys/netinet/in_mcast.c
===================================================================
--- sys/netinet/in_mcast.c
+++ sys/netinet/in_mcast.c
@@ -264,7 +264,9 @@
ifma = inm->inm_ifma;
if_ref(ifp);
- TAILQ_REMOVE(&ifp->if_multiaddrs, ifma, ifma_link);
+ CK_STAILQ_REMOVE(&ifp->if_multiaddrs, ifma, ifmultiaddr, ifma_link);
+ /* mark as unlinked */
+ ifma->ifma_addr->sa_family = AF_UNSPEC;
MCDPRINTF("removed ifma: %p from %s\n", ifma, ifp->if_xname);
if ((ll_ifma = ifma->ifma_llifma) != NULL) {
MPASS(ifma != ll_ifma);
@@ -272,7 +274,9 @@
MPASS(ll_ifma->ifma_llifma == NULL);
MPASS(ll_ifma->ifma_ifp == ifp);
if (--ll_ifma->ifma_refcount == 0) {
- TAILQ_REMOVE(&ifp->if_multiaddrs, ll_ifma, ifma_link);
+ CK_STAILQ_REMOVE(&ifp->if_multiaddrs, ll_ifma, ifmultiaddr, ifma_link);
+ /* mark as unlinked */
+ ll_ifma->ifma_addr->sa_family = AF_UNSPEC;
MCDPRINTF("removed ll_ifma: %p from %s\n", ll_ifma, ifp->if_xname);
if_freemulti(ll_ifma);
ifma_restart = true;
@@ -343,7 +347,7 @@
IF_ADDR_LOCK_ASSERT(ifp);
inm = NULL;
- TAILQ_FOREACH(ifma, &((ifp)->if_multiaddrs), ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &((ifp)->if_multiaddrs), ifma_link) {
if (ifma->ifma_addr->sa_family == AF_INET) {
inm = (struct in_multi *)ifma->ifma_protospec;
if (inm->inm_addr.s_addr == ina.s_addr)
@@ -2015,7 +2019,7 @@
mifp = NULL;
IN_IFADDR_RLOCK(&in_ifa_tracker);
- TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) {
+ CK_STAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) {
mifp = ia->ia_ifp;
if (!(mifp->if_flags & IFF_LOOPBACK) &&
(mifp->if_flags & IFF_MULTICAST)) {
@@ -3007,7 +3011,7 @@
IN_MULTI_LIST_LOCK();
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_INET ||
ifma->ifma_protospec == NULL)
continue;
Index: sys/netinet/in_pcb.c
===================================================================
--- sys/netinet/in_pcb.c
+++ sys/netinet/in_pcb.c
@@ -586,7 +586,7 @@
INP_LOCK_ASSERT(inp);
INP_HASH_LOCK_ASSERT(pcbinfo);
- if (TAILQ_EMPTY(&V_in_ifaddrhead)) /* XXX broken! */
+ if (CK_STAILQ_EMPTY(&V_in_ifaddrhead)) /* XXX broken! */
return (EADDRNOTAVAIL);
laddr.s_addr = *laddrp;
if (nam != NULL && laddr.s_addr != INADDR_ANY)
@@ -851,7 +851,7 @@
ifa_free(&ia->ia_ifa);
ia = NULL;
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
sa = ifa->ifa_addr;
if (sa->sa_family != AF_INET)
@@ -910,7 +910,7 @@
ia = NULL;
ifp = sro.ro_rt->rt_ifp;
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
sa = ifa->ifa_addr;
if (sa->sa_family != AF_INET)
continue;
@@ -976,7 +976,7 @@
ifa_free(&ia->ia_ifa);
ia = NULL;
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
sa = ifa->ifa_addr;
if (sa->sa_family != AF_INET)
@@ -1055,7 +1055,7 @@
faddr = sin->sin_addr;
fport = sin->sin_port;
- if (!TAILQ_EMPTY(&V_in_ifaddrhead)) {
+ if (!CK_STAILQ_EMPTY(&V_in_ifaddrhead)) {
/*
* If the destination address is INADDR_ANY,
* use the primary local address.
@@ -1066,16 +1066,16 @@
if (faddr.s_addr == INADDR_ANY) {
IN_IFADDR_RLOCK(&in_ifa_tracker);
faddr =
- IA_SIN(TAILQ_FIRST(&V_in_ifaddrhead))->sin_addr;
+ IA_SIN(CK_STAILQ_FIRST(&V_in_ifaddrhead))->sin_addr;
IN_IFADDR_RUNLOCK(&in_ifa_tracker);
if (cred != NULL &&
(error = prison_get_ip4(cred, &faddr)) != 0)
return (error);
} else if (faddr.s_addr == (u_long)INADDR_BROADCAST) {
IN_IFADDR_RLOCK(&in_ifa_tracker);
- if (TAILQ_FIRST(&V_in_ifaddrhead)->ia_ifp->if_flags &
+ if (CK_STAILQ_FIRST(&V_in_ifaddrhead)->ia_ifp->if_flags &
IFF_BROADCAST)
- faddr = satosin(&TAILQ_FIRST(
+ faddr = satosin(&CK_STAILQ_FIRST(
&V_in_ifaddrhead)->ia_broadaddr)->sin_addr;
IN_IFADDR_RUNLOCK(&in_ifa_tracker);
}
@@ -1096,7 +1096,7 @@
if (imo->imo_multicast_ifp != NULL) {
ifp = imo->imo_multicast_ifp;
IN_IFADDR_RLOCK(&in_ifa_tracker);
- TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) {
+ CK_STAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) {
if ((ia->ia_ifp == ifp) &&
(cred == NULL ||
prison_check_ip4(cred,
Index: sys/netinet/in_var.h
===================================================================
--- sys/netinet/in_var.h
+++ sys/netinet/in_var.h
@@ -80,7 +80,7 @@
u_long ia_subnet; /* subnet address */
u_long ia_subnetmask; /* mask of subnet */
LIST_ENTRY(in_ifaddr) ia_hash; /* entry in bucket of inet addresses */
- TAILQ_ENTRY(in_ifaddr) ia_link; /* list of internet addresses */
+ CK_STAILQ_ENTRY(in_ifaddr) ia_link; /* list of internet addresses */
struct sockaddr_in ia_addr; /* reserve space for interface name */
struct sockaddr_in ia_dstaddr; /* reserve space for broadcast addr */
#define ia_broadaddr ia_dstaddr
@@ -107,7 +107,7 @@
/*
* Hash table for IP addresses.
*/
-TAILQ_HEAD(in_ifaddrhead, in_ifaddr);
+CK_STAILQ_HEAD(in_ifaddrhead, in_ifaddr);
LIST_HEAD(in_ifaddrhashhead, in_ifaddr);
VNET_DECLARE(struct in_ifaddrhashhead *, in_ifaddrhashtbl);
@@ -172,9 +172,9 @@
/* struct rm_priotracker *t; */ \
do { \
IN_IFADDR_RLOCK((t)); \
- for ((ia) = TAILQ_FIRST(&V_in_ifaddrhead); \
+ for ((ia) = CK_STAILQ_FIRST(&V_in_ifaddrhead); \
(ia) != NULL && (ia)->ia_ifp != (ifp); \
- (ia) = TAILQ_NEXT((ia), ia_link)) \
+ (ia) = CK_STAILQ_NEXT((ia), ia_link)) \
continue; \
if ((ia) != NULL) \
ifa_ref(&(ia)->ia_ifa); \
Index: sys/netinet/ip_carp.c
===================================================================
--- sys/netinet/ip_carp.c
+++ sys/netinet/ip_carp.c
@@ -276,8 +276,7 @@
} while (0)
#define IFNET_FOREACH_IFA(ifp, ifa) \
- IF_ADDR_LOCK_ASSERT(ifp); \
- TAILQ_FOREACH((ifa), &(ifp)->if_addrhead, ifa_link) \
+ CK_STAILQ_FOREACH((ifa), &(ifp)->if_addrhead, ifa_link) \
if ((ifa)->ifa_carp != NULL)
#define CARP_FOREACH_IFA(sc, ifa) \
@@ -878,7 +877,7 @@
return (NULL);
best = NULL;
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family == af &&
(best == NULL || ifa_preferred(best, ifa)))
best = ifa;
@@ -1160,7 +1159,7 @@
ifa = NULL;
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
if (!IN6_ARE_ADDR_EQUAL(taddr, IFA_IN6(ifa)))
Index: sys/netinet/ip_divert.c
===================================================================
--- sys/netinet/ip_divert.c
+++ sys/netinet/ip_divert.c
@@ -74,7 +74,6 @@
#endif
#include <security/mac/mac_framework.h>
-
/*
* Divert sockets
*/
@@ -235,7 +234,7 @@
/* Find IP address for receive interface */
ifp = m->m_pkthdr.rcvif;
if_addr_rlock(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET)
continue;
divsrc.sin_addr =
Index: sys/netinet/ip_icmp.c
===================================================================
--- sys/netinet/ip_icmp.c
+++ sys/netinet/ip_icmp.c
@@ -69,6 +69,7 @@
#include <netinet/tcpip.h>
#include <netinet/icmp_var.h>
+
#ifdef INET
#include <machine/in_cksum.h>
@@ -760,7 +761,7 @@
ifp = m->m_pkthdr.rcvif;
if (ifp != NULL && ifp->if_flags & IFF_BROADCAST) {
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET)
continue;
ia = ifatoia(ifa);
@@ -781,7 +782,7 @@
*/
if (V_icmp_rfi && ifp != NULL) {
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET)
continue;
ia = ifatoia(ifa);
@@ -799,7 +800,7 @@
*/
if (V_reply_src[0] != '\0' && (ifp = ifunit(V_reply_src))) {
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET)
continue;
ia = ifatoia(ifa);
Index: sys/netinet/ip_input.c
===================================================================
--- sys/netinet/ip_input.c
+++ sys/netinet/ip_input.c
@@ -304,7 +304,7 @@
struct protosw *pr;
int i;
- TAILQ_INIT(&V_in_ifaddrhead);
+ CK_STAILQ_INIT(&V_in_ifaddrhead);
V_in_ifaddrhashtbl = hashinit(INADDR_NHASH, M_IFADDR, &V_in_ifaddrhmask);
/* Initialize IP reassembly queue. */
@@ -650,7 +650,7 @@
* we receive might be for us (and let the upper layers deal
* with it).
*/
- if (TAILQ_EMPTY(&V_in_ifaddrhead) &&
+ if (CK_STAILQ_EMPTY(&V_in_ifaddrhead) &&
(m->m_flags & (M_MCAST|M_BCAST)) == 0)
goto ours;
@@ -707,7 +707,7 @@
*/
if (ifp != NULL && ifp->if_flags & IFF_BROADCAST) {
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET)
continue;
ia = ifatoia(ifa);
Index: sys/netinet/raw_ip.c
===================================================================
--- sys/netinet/raw_ip.c
+++ sys/netinet/raw_ip.c
@@ -743,7 +743,7 @@
switch (cmd) {
case PRC_IFDOWN:
IN_IFADDR_RLOCK(&in_ifa_tracker);
- TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) {
+ CK_STAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) {
if (ia->ia_ifa.ifa_addr == sa
&& (ia->ia_flags & IFA_ROUTE)) {
ifa_ref(&ia->ia_ifa);
@@ -769,7 +769,7 @@
case PRC_IFUP:
IN_IFADDR_RLOCK(&in_ifa_tracker);
- TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) {
+ CK_STAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) {
if (ia->ia_ifa.ifa_addr == sa)
break;
}
Index: sys/netinet/sctp_bsd_addr.c
===================================================================
--- sys/netinet/sctp_bsd_addr.c
+++ sys/netinet/sctp_bsd_addr.c
@@ -213,7 +213,7 @@
continue;
}
IF_ADDR_RLOCK(ifn);
- TAILQ_FOREACH(ifa, &ifn->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifn->if_addrhead, ifa_link) {
if (ifa->ifa_addr == NULL) {
continue;
}
@@ -364,7 +364,7 @@
if (!(*pred) (ifn)) {
continue;
}
- TAILQ_FOREACH(ifa, &ifn->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifn->if_addrhead, ifa_link) {
sctp_addr_change(ifa, add ? RTM_ADD : RTM_DELETE);
}
}
Index: sys/netinet6/icmp6.c
===================================================================
--- sys/netinet6/icmp6.c
+++ sys/netinet6/icmp6.c
@@ -1680,7 +1680,7 @@
TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
addrsofif = 0;
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
ifa6 = (struct in6_ifaddr *)ifa;
@@ -1766,7 +1766,7 @@
for (; ifp; ifp = TAILQ_NEXT(ifp, if_link)) {
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
ifa6 = (struct in6_ifaddr *)ifa;
Index: sys/netinet6/in6.c
===================================================================
--- sys/netinet6/in6.c
+++ sys/netinet6/in6.c
@@ -112,6 +112,7 @@
#include <netinet6/in6_fib.h>
#include <netinet6/in6_pcb.h>
+
/*
* struct in6_ifreq and struct ifreq must be type punnable for common members
* of ifr_ifru to allow accessors to be shared.
@@ -1118,12 +1119,12 @@
ia->ia_ifp = ifp;
ifa_ref(&ia->ia_ifa); /* if_addrhead */
IF_ADDR_WLOCK(ifp);
- TAILQ_INSERT_TAIL(&ifp->if_addrhead, &ia->ia_ifa, ifa_link);
+ CK_STAILQ_INSERT_TAIL(&ifp->if_addrhead, &ia->ia_ifa, ifa_link);
IF_ADDR_WUNLOCK(ifp);
ifa_ref(&ia->ia_ifa); /* in6_ifaddrhead */
IN6_IFADDR_WLOCK();
- TAILQ_INSERT_TAIL(&V_in6_ifaddrhead, ia, ia_link);
+ CK_STAILQ_INSERT_TAIL(&V_in6_ifaddrhead, ia, ia_link);
LIST_INSERT_HEAD(IN6ADDR_HASH(&ia->ia_addr.sin6_addr), ia, ia6_hash);
IN6_IFADDR_WUNLOCK();
@@ -1322,7 +1323,9 @@
int remove_lle;
IF_ADDR_WLOCK(ifp);
- TAILQ_REMOVE(&ifp->if_addrhead, &ia->ia_ifa, ifa_link);
+ CK_STAILQ_REMOVE(&ifp->if_addrhead, &ia->ia_ifa, ifaddr, ifa_link);
+ /* mark as unlinked */
+ ia->ia_ifa.ifa_addr->sa_family = AF_UNSPEC;
IF_ADDR_WUNLOCK(ifp);
ifa_free(&ia->ia_ifa); /* if_addrhead */
@@ -1332,8 +1335,10 @@
* cleanup.
*/
IN6_IFADDR_WLOCK();
- TAILQ_REMOVE(&V_in6_ifaddrhead, ia, ia_link);
+ CK_STAILQ_REMOVE(&V_in6_ifaddrhead, ia, in6_ifaddr, ia_link);
LIST_REMOVE(ia, ia6_hash);
+ /* mark as unlinked */
+ ia->ia_ifa.ifa_addr->sa_family = AF_UNSPEC;
IN6_IFADDR_WUNLOCK();
/*
@@ -1387,7 +1392,7 @@
*/
if (hostIsNew != 0) {
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
ifacount++;
@@ -1470,7 +1475,7 @@
struct ifaddr *ifa;
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
if (IN6_IS_ADDR_LINKLOCAL(IFA_IN6(ifa))) {
@@ -1521,7 +1526,7 @@
struct ifaddr *ifa;
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
if (IN6_ARE_ADDR_EQUAL(addr, IFA_IN6(ifa))) {
@@ -1546,7 +1551,7 @@
if (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED)
return (NULL);
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
sin6 = (struct sockaddr_in6 *)ifa->ifa_addr;
@@ -1652,7 +1657,7 @@
return 1;
IN6_IFADDR_RLOCK(&in6_ifa_tracker);
- TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) {
+ CK_STAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) {
if (IN6_ARE_MASKED_ADDR_EQUAL(in6, &ia->ia_addr.sin6_addr,
&ia->ia_prefixmask.sin6_addr)) {
IN6_IFADDR_RUNLOCK(&in6_ifa_tracker);
@@ -1701,7 +1706,7 @@
in6_setscope(&in6, ifp, NULL);
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
ia6 = (struct in6_ifaddr *)ifa;
@@ -1828,7 +1833,7 @@
* If none, return one of global addresses assigned other ifs.
*/
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
if (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_ANYCAST)
@@ -1865,7 +1870,7 @@
return (besta);
}
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
if (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_ANYCAST)
@@ -1912,7 +1917,7 @@
struct in6_ifaddr *ia;
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
ia = (struct in6_ifaddr *)ifa;
Index: sys/netinet6/in6_ifattach.c
===================================================================
--- sys/netinet6/in6_ifattach.c
+++ sys/netinet6/in6_ifattach.c
@@ -249,7 +249,7 @@
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_LINK)
continue;
sdl = (struct sockaddr_dl *)ifa->ifa_addr;
@@ -751,7 +751,7 @@
* nuke any of IPv6 addresses we have
* XXX: all addresses should be already removed
*/
- TAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, next) {
+ CK_STAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, next) {
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
in6_purgeaddr(ifa);
@@ -859,7 +859,7 @@
* which the PF_INET6 layer is about to release.
*/
restart:
- TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) {
+ CK_STAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) {
if (ifma->ifma_addr->sa_family != AF_INET6 ||
ifma->ifma_protospec == NULL)
continue;
Index: sys/netinet6/in6_mcast.c
===================================================================
--- sys/netinet6/in6_mcast.c
+++ sys/netinet6/in6_mcast.c
@@ -589,7 +589,9 @@
ifma = inm->in6m_ifma;
if_ref(ifp);
- TAILQ_REMOVE(&ifp->if_multiaddrs, ifma, ifma_link);
+ CK_STAILQ_REMOVE(&ifp->if_multiaddrs, ifma, ifmultiaddr, ifma_link);
+ /* mark as unlinked */
+ ifma->ifma_addr->sa_family = AF_UNSPEC;
MCDPRINTF("removed ifma: %p from %s\n", ifma, ifp->if_xname);
if ((ll_ifma = ifma->ifma_llifma) != NULL) {
MPASS(ifma != ll_ifma);
@@ -598,12 +600,14 @@
MPASS(ll_ifma->ifma_ifp == ifp);
if (--ll_ifma->ifma_refcount == 0) {
ifma6_restart = true;
- TAILQ_REMOVE(&ifp->if_multiaddrs, ll_ifma, ifma_link);
+ CK_STAILQ_REMOVE(&ifp->if_multiaddrs, ll_ifma, ifmultiaddr, ifma_link);
+ /* mark as unlinked */
+ ll_ifma->ifma_addr->sa_family = AF_UNSPEC;
MCDPRINTF("removed ll_ifma: %p from %s\n", ll_ifma, ifp->if_xname);
if_freemulti(ll_ifma);
}
}
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
ifa6 = (void *)ifa;
@@ -1297,7 +1301,7 @@
if (error) {
CTR2(KTR_MLD, "%s: dropping ref on %p", __func__, inm);
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_protospec == inm) {
ifma->ifma_protospec = NULL;
break;
@@ -2822,7 +2826,7 @@
IN6_MULTI_LOCK();
IN6_MULTI_LIST_LOCK();
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_INET6 ||
ifma->ifma_protospec == NULL)
continue;
Index: sys/netinet6/in6_pcb.c
===================================================================
--- sys/netinet6/in6_pcb.c
+++ sys/netinet6/in6_pcb.c
@@ -128,7 +128,7 @@
INP_WLOCK_ASSERT(inp);
INP_HASH_WLOCK_ASSERT(pcbinfo);
- if (TAILQ_EMPTY(&V_in6_ifaddrhead)) /* XXX broken! */
+ if (CK_STAILQ_EMPTY(&V_in6_ifaddrhead)) /* XXX broken! */
return (EADDRNOTAVAIL);
if (inp->inp_lport || !IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr))
return (EINVAL);
@@ -349,7 +349,7 @@
if ((error = sa6_embedscope(sin6, V_ip6_use_defzone)) != 0)
return(error);
- if (!TAILQ_EMPTY(&V_in6_ifaddrhead)) {
+ if (!CK_STAILQ_EMPTY(&V_in6_ifaddrhead)) {
/*
* If the destination address is UNSPECIFIED addr,
* use the loopback addr, e.g ::1.
Index: sys/netinet6/in6_src.c
===================================================================
--- sys/netinet6/in6_src.c
+++ sys/netinet6/in6_src.c
@@ -309,7 +309,7 @@
return (error);
IN6_IFADDR_RLOCK(&in6_ifa_tracker);
- TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) {
+ CK_STAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) {
int new_scope = -1, new_matchlen = -1;
struct in6_addrpolicy *new_policy = NULL;
u_int32_t srczone, osrczone, dstzone;
Index: sys/netinet6/in6_var.h
===================================================================
--- sys/netinet6/in6_var.h
+++ sys/netinet6/in6_var.h
@@ -127,7 +127,7 @@
struct sockaddr_in6 ia_dstaddr; /* space for destination addr */
struct sockaddr_in6 ia_prefixmask; /* prefix mask */
u_int32_t ia_plen; /* prefix length */
- TAILQ_ENTRY(in6_ifaddr) ia_link; /* list of IPv6 addresses */
+ STAILQ_ENTRY(in6_ifaddr) ia_link; /* list of IPv6 addresses */
int ia6_flags;
struct in6_addrlifetime ia6_lifetime;
@@ -146,7 +146,7 @@
};
/* List of in6_ifaddr's. */
-TAILQ_HEAD(in6_ifaddrhead, in6_ifaddr);
+STAILQ_HEAD(in6_ifaddrhead, in6_ifaddr);
LIST_HEAD(in6_ifaddrlisthead, in6_ifaddr);
#endif /* _KERNEL */
@@ -727,10 +727,8 @@
struct ifmultiaddr *ifma;
struct in6_multi *inm;
- IF_ADDR_LOCK_ASSERT(ifp);
-
inm = NULL;
- TAILQ_FOREACH(ifma, &((ifp)->if_multiaddrs), ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &((ifp)->if_multiaddrs), ifma_link) {
if (ifma->ifma_addr->sa_family == AF_INET6) {
inm = (struct in6_multi *)ifma->ifma_protospec;
if (inm == NULL)
Index: sys/netinet6/ip6_input.c
===================================================================
--- sys/netinet6/ip6_input.c
+++ sys/netinet6/ip6_input.c
@@ -222,7 +222,7 @@
TUNABLE_INT_FETCH("net.inet6.ip6.accept_rtadv", &V_ip6_accept_rtadv);
TUNABLE_INT_FETCH("net.inet6.ip6.no_radr", &V_ip6_no_radr);
- TAILQ_INIT(&V_in6_ifaddrhead);
+ CK_STAILQ_INIT(&V_in6_ifaddrhead);
V_in6_ifaddrhashtbl = hashinit(IN6ADDR_NHASH, M_IFADDR,
&V_in6_ifaddrhmask);
@@ -380,7 +380,7 @@
TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
/* Cannot lock here - lock recursion. */
/* IF_ADDR_LOCK(ifp); */
- TAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, nifa) {
+ CK_STAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, nifa) {
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
Index: sys/netinet6/mld6.c
===================================================================
--- sys/netinet6/mld6.c
+++ sys/netinet6/mld6.c
@@ -551,7 +551,7 @@
if (mli->mli_version == MLD_VERSION_2) {
IF_ADDR_WLOCK(ifp);
restart:
- TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) {
+ CK_STAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) {
if (ifma->ifma_addr->sa_family != AF_INET6 ||
ifma->ifma_protospec == NULL)
continue;
@@ -702,7 +702,7 @@
*/
CTR2(KTR_MLD, "process v1 general query on ifp %p(%s)",
ifp, if_name(ifp));
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_INET6 ||
ifma->ifma_protospec == NULL)
continue;
@@ -1395,7 +1395,7 @@
IF_ADDR_WLOCK(ifp);
restart:
- TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) {
+ CK_STAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) {
if (ifma->ifma_addr->sa_family != AF_INET6 ||
ifma->ifma_protospec == NULL)
continue;
@@ -1678,7 +1678,7 @@
IF_ADDR_WLOCK(ifp);
restart:
- TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) {
+ CK_STAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) {
if (ifma->ifma_addr->sa_family != AF_INET6)
continue;
inm = (struct in6_multi *)ifma->ifma_protospec;
@@ -2999,7 +2999,7 @@
ifp = mli->mli_ifp;
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
if (ifma->ifma_addr->sa_family != AF_INET6 ||
ifma->ifma_protospec == NULL)
continue;
Index: sys/netinet6/nd6.c
===================================================================
--- sys/netinet6/nd6.c
+++ sys/netinet6/nd6.c
@@ -301,7 +301,7 @@
struct ifaddr *ifa, *next;
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, next) {
+ CK_STAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, next) {
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
@@ -922,7 +922,7 @@
* XXXRW: in6_ifaddrhead locking.
*/
addrloop:
- TAILQ_FOREACH_SAFE(ia6, &V_in6_ifaddrhead, ia_link, nia6) {
+ CK_STAILQ_FOREACH_SAFE(ia6, &V_in6_ifaddrhead, ia_link, nia6) {
/* check address lifetime */
if (IFA6_IS_INVALID(ia6)) {
int regen = 0;
@@ -1068,7 +1068,7 @@
ifp = ia6->ia_ifa.ifa_ifp;
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
struct in6_ifaddr *it6;
if (ifa->ifa_addr->sa_family != AF_INET6)
@@ -1344,7 +1344,7 @@
*/
if (ifp->if_flags & IFF_POINTOPOINT) {
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != addr->sin6_family)
continue;
if (ifa->ifa_dstaddr != NULL &&
@@ -1687,7 +1687,7 @@
* See RFC 4862, Section 5.4.5.
*/
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
ia = (struct in6_ifaddr *)ifa;
@@ -1717,7 +1717,7 @@
if (V_ip6_dad_count > 0 &&
(ND_IFINFO(ifp)->flags & ND6_IFF_NO_DAD) == 0) {
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead,
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead,
ifa_link) {
if (ifa->ifa_addr->sa_family !=
AF_INET6)
@@ -1745,7 +1745,7 @@
* assign one.
*/
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead,
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead,
ifa_link) {
if (ifa->ifa_addr->sa_family !=
AF_INET6)
@@ -1789,7 +1789,7 @@
while ((pr = LIST_FIRST(&prl)) != NULL) {
LIST_REMOVE(pr, ndpr_entry);
/* XXXRW: in6_ifaddrhead locking. */
- TAILQ_FOREACH_SAFE(ia, &V_in6_ifaddrhead, ia_link,
+ CK_STAILQ_FOREACH_SAFE(ia, &V_in6_ifaddrhead, ia_link,
ia_next) {
if ((ia->ia6_flags & IN6_IFF_AUTOCONF) == 0)
continue;
Index: sys/netinet6/nd6_rtr.c
===================================================================
--- sys/netinet6/nd6_rtr.c
+++ sys/netinet6/nd6_rtr.c
@@ -478,7 +478,7 @@
ifp = rt->rt_ifp;
if (ifp != NULL) {
IF_ADDR_RLOCK(ifp);
- ifa = TAILQ_FIRST(&ifp->if_addrhead);
+ ifa = CK_STAILQ_FIRST(&ifp->if_addrhead);
info.rti_info[RTAX_IFP] = ifa->ifa_addr;
ifa_ref(ifa);
IF_ADDR_RUNLOCK(ifp);
@@ -1347,7 +1347,7 @@
* "address".
*/
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
struct in6_ifaddr *ifa6;
u_int32_t remaininglifetime;
@@ -1719,7 +1719,7 @@
* The precise detection logic is same as the one for prefixes.
*/
IN6_IFADDR_RLOCK(&in6_ifa_tracker);
- TAILQ_FOREACH(ifa, &V_in6_ifaddrhead, ia_link) {
+ CK_STAILQ_FOREACH(ifa, &V_in6_ifaddrhead, ia_link) {
if (!(ifa->ia6_flags & IN6_IFF_AUTOCONF))
continue;
@@ -1736,7 +1736,7 @@
break;
}
if (ifa) {
- TAILQ_FOREACH(ifa, &V_in6_ifaddrhead, ia_link) {
+ CK_STAILQ_FOREACH(ifa, &V_in6_ifaddrhead, ia_link) {
if ((ifa->ia6_flags & IN6_IFF_AUTOCONF) == 0)
continue;
@@ -1754,7 +1754,7 @@
}
}
} else {
- TAILQ_FOREACH(ifa, &V_in6_ifaddrhead, ia_link) {
+ CK_STAILQ_FOREACH(ifa, &V_in6_ifaddrhead, ia_link) {
if ((ifa->ia6_flags & IN6_IFF_AUTOCONF) == 0)
continue;
@@ -1908,7 +1908,7 @@
if (ifa == NULL) {
/* XXX: freebsd does not have ifa_ifwithaf */
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family == AF_INET6) {
ifa_ref(ifa);
break;
Index: sys/netpfil/ipfw/ip_fw2.c
===================================================================
--- sys/netpfil/ipfw/ip_fw2.c
+++ sys/netpfil/ipfw/ip_fw2.c
@@ -402,7 +402,7 @@
struct ifaddr *ia;
if_addr_rlock(ifp);
- TAILQ_FOREACH(ia, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ia, &ifp->if_addrhead, ifa_link) {
if (ia->ifa_addr->sa_family != AF_INET)
continue;
if (cmd->p.ip.s_addr == ((struct sockaddr_in *)
@@ -767,7 +767,7 @@
return (in6_localip(in6));
IN6_IFADDR_RLOCK(&in6_ifa_tracker);
- TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) {
+ CK_STAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) {
if (!IN6_IS_ADDR_LINKLOCAL(&ia->ia_addr.sin6_addr))
continue;
if (IN6_ARE_MASKED_ADDR_EQUAL(&ia->ia_addr.sin6_addr,
Index: sys/netpfil/ipfw/ip_fw_dynamic.c
===================================================================
--- sys/netpfil/ipfw/ip_fw_dynamic.c
+++ sys/netpfil/ipfw/ip_fw_dynamic.c
@@ -77,7 +77,6 @@
#ifdef MAC
#include <security/mac/mac_framework.h>
#endif
-#include <ck_queue.h>
/*
* Description of dynamic states.
Index: sys/netpfil/ipfw/ip_fw_nat.c
===================================================================
--- sys/netpfil/ipfw/ip_fw_nat.c
+++ sys/netpfil/ipfw/ip_fw_nat.c
@@ -119,7 +119,7 @@
if (strncmp(ptr->if_name, ifp->if_xname, IF_NAMESIZE) != 0)
continue;
if_addr_rlock(ifp);
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr == NULL)
continue;
if (ifa->ifa_addr->sa_family != AF_INET)
Index: sys/netpfil/pf/pf_if.c
===================================================================
--- sys/netpfil/pf/pf_if.c
+++ sys/netpfil/pf/pf_if.c
@@ -525,7 +525,7 @@
int net2, af;
IF_ADDR_RLOCK(ifp);
- TAILQ_FOREACH(ia, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ia, &ifp->if_addrhead, ifa_link) {
if (ia->ifa_addr == NULL)
continue;
af = ia->ifa_addr->sa_family;
Index: sys/nfs/bootp_subr.c
===================================================================
--- sys/nfs/bootp_subr.c
+++ sys/nfs/bootp_subr.c
@@ -84,7 +84,6 @@
#include <nfs/krpc.h>
#include <nfs/xdr_subs.h>
-
#define BOOTP_MIN_LEN 300 /* Minimum size of bootp udp packet */
#ifndef BOOTP_SETTLE_DELAY
@@ -413,7 +412,7 @@
for (ifp = TAILQ_FIRST(&V_ifnet);
ifp != NULL;
ifp = TAILQ_NEXT(ifp, if_link)) {
- for (ifa = TAILQ_FIRST(&ifp->if_addrhead);
+ for (ifa = CK_STAILQ_FIRST(&ifp->if_addrhead);
ifa != NULL;
ifa = TAILQ_NEXT(ifa, ifa_link))
if (ifa->ifa_addr->sa_family == AF_INET)
@@ -1685,7 +1684,7 @@
/* Get HW address */
sdl = NULL;
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
if (ifa->ifa_addr->sa_family == AF_LINK) {
sdl = (struct sockaddr_dl *)ifa->ifa_addr;
if (sdl->sdl_type == IFT_ETHER)
Index: sys/nfs/nfs_diskless.c
===================================================================
--- sys/nfs/nfs_diskless.c
+++ sys/nfs/nfs_diskless.c
@@ -225,7 +225,7 @@
CURVNET_SET(TD_TO_VNET(curthread));
IFNET_RLOCK();
TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
- TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family == AF_LINK) {
sdl = (struct sockaddr_dl *)ifa->ifa_addr;
if ((sdl->sdl_type == ourdl.sdl_type) &&
Index: sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c
===================================================================
--- sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c
+++ sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c
@@ -202,7 +202,7 @@
/* clone address information for IPv4 and IPv6 */
IF_ADDR_RLOCK(idev);
#if defined(INET)
- TAILQ_FOREACH(ifa, &idev->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &idev->if_addrhead, ifa_link) {
if (ifa->ifa_addr == NULL ||
ifa->ifa_addr->sa_family != AF_INET)
continue;
@@ -218,7 +218,7 @@
}
#endif
#if defined(INET6)
- TAILQ_FOREACH(ifa, &idev->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &idev->if_addrhead, ifa_link) {
if (ifa->ifa_addr == NULL ||
ifa->ifa_addr->sa_family != AF_INET6)
continue;
Index: sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
===================================================================
--- sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -760,7 +760,7 @@
/* Mark all of the entries that are found or don't exist */
- TAILQ_FOREACH(ifma, &dev->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(ifma, &dev->if_multiaddrs, ifma_link) {
union ib_gid mgid;
uint8_t *addr;
Index: sys/ofed/include/rdma/ib_addr.h
===================================================================
--- sys/ofed/include/rdma/ib_addr.h
+++ sys/ofed/include/rdma/ib_addr.h
@@ -52,6 +52,7 @@
#include <rdma/ib_pack.h>
#include <net/ipv6.h>
+
struct rdma_addr_client {
atomic_t refcount;
struct completion comp;
@@ -219,7 +220,7 @@
dev = dev_get_by_index(&init_net, dev_addr->bound_dev_if);
if (dev) {
- TAILQ_FOREACH(ifa, &dev->if_addrhead, ifa_link) {
+ CK_STAILQ_FOREACH(ifa, &dev->if_addrhead, ifa_link) {
if (ifa->ifa_addr == NULL ||
ifa->ifa_addr->sa_family != AF_INET)
continue;
Index: sys/powerpc/ps3/if_glc.c
===================================================================
--- sys/powerpc/ps3/if_glc.c
+++ sys/powerpc/ps3/if_glc.c
@@ -524,7 +524,7 @@
} else {
if_maddr_rlock(ifp);
naddrs = 1; /* Include broadcast */
- TAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) {
if (inm->ifma_addr->sa_family != AF_LINK)
continue;
addr = 0;
Index: sys/powerpc/pseries/phyp_llan.c
===================================================================
--- sys/powerpc/pseries/phyp_llan.c
+++ sys/powerpc/pseries/phyp_llan.c
@@ -509,7 +509,7 @@
phyp_hcall(H_MULTICAST_CTRL, sc->unit, LLAN_CLEAR_MULTICAST, 0);
if_maddr_rlock(ifp);
- TAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) {
+ CK_STAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) {
if (inm->ifma_addr->sa_family != AF_LINK)
continue;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 19, 1:01 AM (4 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15867242
Default Alt Text
D15366.id42392.diff (113 KB)
Attached To
Mode
D15366: Replace if_addr_lock rwlock with epoch + mutex
Attached
Detach File
Event Timeline
Log In to Comment