Naming the list like the struct itself makes for awful grepping.
Distinguish the list name;  no functional change.

Builds/runs fine on and64 and sparc64.

Feedback? Objection? OK?
Naming bikeshed (ifnet_tailq, ifnet_list)?

diff --git a/sys/arch/amd64/amd64/autoconf.c b/sys/arch/amd64/amd64/autoconf.c
index 6ae7b28f6d9..979b043c184 100644
--- a/sys/arch/amd64/amd64/autoconf.c
+++ b/sys/arch/amd64/amd64/autoconf.c
@@ -195,7 +195,7 @@ diskconf(void)
        if (bios_bootmac) {
                struct ifnet *ifp;
 
-               TAILQ_FOREACH(ifp, &ifnet, if_list) {
+               TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                        if (ifp->if_type == IFT_ETHER &&
                            memcmp(bios_bootmac->mac,
                            ((struct arpcom *)ifp)->ac_enaddr,
diff --git a/sys/arch/arm64/arm64/autoconf.c b/sys/arch/arm64/arm64/autoconf.c
index bda3cb3f6b0..dd0449c5eed 100644
--- a/sys/arch/arm64/arm64/autoconf.c
+++ b/sys/arch/arm64/arm64/autoconf.c
@@ -84,7 +84,7 @@ diskconf(void)
        if (bootmac) {
                struct ifnet *ifp;
 
-               TAILQ_FOREACH(ifp, &ifnet, if_list) {
+               TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                        if (ifp->if_type == IFT_ETHER &&
                            memcmp(bootmac, ((struct arpcom *)ifp)->ac_enaddr,
                            ETHER_ADDR_LEN) == 0)
diff --git a/sys/arch/armv7/armv7/autoconf.c b/sys/arch/armv7/armv7/autoconf.c
index 00134c44423..0b290eb1db8 100644
--- a/sys/arch/armv7/armv7/autoconf.c
+++ b/sys/arch/armv7/armv7/autoconf.c
@@ -125,7 +125,7 @@ diskconf(void)
        if (bootmac) {
                struct ifnet *ifp;
 
-               TAILQ_FOREACH(ifp, &ifnet, if_list) {
+               TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                        if (ifp->if_type == IFT_ETHER &&
                            memcmp(bootmac, ((struct arpcom *)ifp)->ac_enaddr,
                            ETHER_ADDR_LEN) == 0)
diff --git a/sys/arch/i386/i386/autoconf.c b/sys/arch/i386/i386/autoconf.c
index 31e9b42f68f..8b3d6d6908b 100644
--- a/sys/arch/i386/i386/autoconf.c
+++ b/sys/arch/i386/i386/autoconf.c
@@ -232,7 +232,7 @@ diskconf(void)
        if (bios_bootmac) {
                struct ifnet *ifp;
 
-               TAILQ_FOREACH(ifp, &ifnet, if_list) {
+               TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                        if (ifp->if_type == IFT_ETHER &&
                            memcmp(bios_bootmac->mac,
                            ((struct arpcom *)ifp)->ac_enaddr,
diff --git a/sys/arch/powerpc64/powerpc64/autoconf.c 
b/sys/arch/powerpc64/powerpc64/autoconf.c
index ef8e29268f3..13b1fa2c66e 100644
--- a/sys/arch/powerpc64/powerpc64/autoconf.c
+++ b/sys/arch/powerpc64/powerpc64/autoconf.c
@@ -54,7 +54,7 @@ diskconf(void)
        if (bootmac) {
                struct ifnet *ifp;
 
-               TAILQ_FOREACH(ifp, &ifnet, if_list) {
+               TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                        if (ifp->if_type == IFT_ETHER &&
                            memcmp(bootmac, ((struct arpcom *)ifp)->ac_enaddr,
                            ETHER_ADDR_LEN) == 0)
diff --git a/sys/arch/riscv64/riscv64/autoconf.c 
b/sys/arch/riscv64/riscv64/autoconf.c
index a447667bd51..0bd09cce7d2 100644
--- a/sys/arch/riscv64/riscv64/autoconf.c
+++ b/sys/arch/riscv64/riscv64/autoconf.c
@@ -72,7 +72,7 @@ diskconf(void)
        if (bootmac) {
                struct ifnet *ifp;
 
-               TAILQ_FOREACH(ifp, &ifnet, if_list) {
+               TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                        if (ifp->if_type == IFT_ETHER &&
                            memcmp(bootmac, ((struct arpcom *)ifp)->ac_enaddr,
                            ETHER_ADDR_LEN) == 0)
diff --git a/sys/dev/pv/hypervic.c b/sys/dev/pv/hypervic.c
index ad5fc9b0c0b..9c7f70dd96f 100644
--- a/sys/dev/pv/hypervic.c
+++ b/sys/dev/pv/hypervic.c
@@ -873,7 +873,7 @@ kvp_get_ip_info(struct hv_kvp *kvp, const uint8_t *mac, 
uint8_t *family,
        KERNEL_LOCK();
        s = splnet();
 
-       TAILQ_FOREACH(ifp, &ifnet, if_list) {
+       TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                if (!memcmp(LLADDR(ifp->if_sadl), enaddr, ETHER_ADDR_LEN))
                        break;
        }
diff --git a/sys/dev/pv/vmt.c b/sys/dev/pv/vmt.c
index 6e97a46dc16..e604499a814 100644
--- a/sys/dev/pv/vmt.c
+++ b/sys/dev/pv/vmt.c
@@ -869,7 +869,7 @@ vmt_tclo_broadcastip(struct vmt_softc *sc)
 
        /* find first available ipv4 address */
        guest_ip = NULL;
-       TAILQ_FOREACH(iface, &ifnet, if_list) {
+       TAILQ_FOREACH(iface, &ifnetlist, if_list) {
                struct ifaddr *iface_addr;
 
                /* skip loopback */
@@ -1301,7 +1301,7 @@ vmt_xdr_nic_info(char *data)
        }
 
        nics = 0;
-       TAILQ_FOREACH(iface, &ifnet, if_list) {
+       TAILQ_FOREACH(iface, &ifnetlist, if_list) {
                nictotal = vmt_xdr_nic_entry(iface, data);
                if (nictotal == 0)
                        continue;
diff --git a/sys/net/if.c b/sys/net/if.c
index 21ee0a39d14..b270c404ae7 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -284,7 +284,7 @@ static struct if_idxmap if_idxmap = {
 struct srp_gc if_ifp_gc = SRP_GC_INITIALIZER(if_ifp_dtor, NULL);
 struct srp_gc if_map_gc = SRP_GC_INITIALIZER(if_map_dtor, NULL);
 
-struct ifnet_head ifnet = TAILQ_HEAD_INITIALIZER(ifnet);
+struct ifnet_head ifnetlist = TAILQ_HEAD_INITIALIZER(ifnetlist);
 
 void
 if_idxmap_init(unsigned int limit)
@@ -566,7 +566,7 @@ if_attachhead(struct ifnet *ifp)
 {
        if_attach_common(ifp);
        NET_LOCK();
-       TAILQ_INSERT_HEAD(&ifnet, ifp, if_list);
+       TAILQ_INSERT_HEAD(&ifnetlist, ifp, if_list);
        if_attachsetup(ifp);
        NET_UNLOCK();
 }
@@ -576,7 +576,7 @@ if_attach(struct ifnet *ifp)
 {
        if_attach_common(ifp);
        NET_LOCK();
-       TAILQ_INSERT_TAIL(&ifnet, ifp, if_list);
+       TAILQ_INSERT_TAIL(&ifnetlist, ifp, if_list);
        if_attachsetup(ifp);
        NET_UNLOCK();
 }
@@ -1014,7 +1014,7 @@ if_remove(struct ifnet *ifp)
 {
        /* Remove the interface from the list of all interfaces. */
        NET_LOCK();
-       TAILQ_REMOVE(&ifnet, ifp, if_list);
+       TAILQ_REMOVE(&ifnetlist, ifp, if_list);
        NET_UNLOCK();
 
        /* Remove the interface from the interface index map. */
@@ -1256,7 +1256,7 @@ if_clone_destroy(const char *name)
 
        rw_enter_write(&if_cloners_lock);
 
-       TAILQ_FOREACH(ifp, &ifnet, if_list) {
+       TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                if (strcmp(ifp->if_xname, name) == 0)
                        break;
        }
@@ -1422,7 +1422,7 @@ ifa_ifwithaddr(const struct sockaddr *addr, u_int 
rtableid)
 
        rdomain = rtable_l2(rtableid);
        KERNEL_LOCK();
-       TAILQ_FOREACH(ifp, &ifnet, if_list) {
+       TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                if (ifp->if_rdomain != rdomain)
                        continue;
 
@@ -1451,7 +1451,7 @@ ifa_ifwithdstaddr(const struct sockaddr *addr, u_int 
rdomain)
 
        rdomain = rtable_l2(rdomain);
        KERNEL_LOCK();
-       TAILQ_FOREACH(ifp, &ifnet, if_list) {
+       TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                if (ifp->if_rdomain != rdomain)
                        continue;
                if (ifp->if_flags & IFF_POINTOPOINT) {
@@ -1608,7 +1608,7 @@ if_downall(void)
        struct ifnet *ifp;
 
        NET_LOCK();
-       TAILQ_FOREACH(ifp, &ifnet, if_list) {
+       TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                if ((ifp->if_flags & IFF_UP) == 0)
                        continue;
                if_down(ifp);
@@ -1763,7 +1763,7 @@ if_unit(const char *name)
 
        KERNEL_ASSERT_LOCKED();
 
-       TAILQ_FOREACH(ifp, &ifnet, if_list) {
+       TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                if (strcmp(ifp->if_xname, name) == 0) {
                        if_ref(ifp);
                        return (ifp);
@@ -2615,7 +2615,7 @@ ifconf(caddr_t data)
 
        /* If ifc->ifc_len is 0, fill it in with the needed size and return. */
        if (space == 0) {
-               TAILQ_FOREACH(ifp, &ifnet, if_list) {
+               TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                        struct sockaddr *sa;
 
                        if (TAILQ_EMPTY(&ifp->if_addrlist))
@@ -2635,7 +2635,7 @@ ifconf(caddr_t data)
        }
 
        ifrp = ifc->ifc_req;
-       TAILQ_FOREACH(ifp, &ifnet, if_list) {
+       TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                if (space < sizeof(ifr))
                        break;
                bcopy(ifp->if_xname, ifr.ifr_name, IFNAMSIZ);
@@ -3173,7 +3173,7 @@ ifa_print_all(void)
        struct ifnet *ifp;
        struct ifaddr *ifa;
 
-       TAILQ_FOREACH(ifp, &ifnet, if_list) {
+       TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) {
                        char addr[INET6_ADDRSTRLEN];
 
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c
index 2ba5b85570c..3a073d4b452 100644
--- a/sys/net/if_loop.c
+++ b/sys/net/if_loop.c
@@ -205,7 +205,7 @@ loop_clone_destroy(struct ifnet *ifp)
 
                /* if there is any other interface in this rdomain, deny */
                NET_LOCK();
-               TAILQ_FOREACH(p, &ifnet, if_list) {
+               TAILQ_FOREACH(p, &ifnetlist, if_list) {
                        if (p->if_rdomain != ifp->if_rdomain)
                                continue;
                        if (p->if_index == ifp->if_index)
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index f511af7dfbd..b6ad30a41f6 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -315,7 +315,7 @@ int         niq_enlist(struct niqueue *, struct mbuf_list 
*);
 #define sysctl_niq(_n, _l, _op, _olp, _np, _nl, _niq) \
     sysctl_mq((_n), (_l), (_op), (_olp), (_np), (_nl), &(_niq)->ni_q)
 
-extern struct ifnet_head ifnet;
+extern struct ifnet_head ifnetlist;
 
 void   if_start(struct ifnet *);
 int    if_enqueue(struct ifnet *, struct mbuf *);
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 6f4ba086c9c..babb988989a 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -857,7 +857,7 @@ route_output(struct mbuf *m, struct socket *so, struct 
sockaddr *dstaddr,
                 */
                if (rtm->rtm_priority == RTP_PROPOSAL_SOLICIT) {
                        NET_LOCK();
-                       TAILQ_FOREACH(ifp, &ifnet, if_list) {
+                       TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                                ifp->if_rtrequest(ifp, RTM_PROPOSAL, NULL);
                        }
                        NET_UNLOCK();
@@ -2035,7 +2035,7 @@ sysctl_iflist(int af, struct walkarg *w)
        int                      len, error = 0;
 
        bzero(&info, sizeof(info));
-       TAILQ_FOREACH(ifp, &ifnet, if_list) {
+       TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                if (w->w_arg && w->w_arg != ifp->if_index)
                        continue;
                /* Copy the link-layer address first */
@@ -2093,7 +2093,7 @@ sysctl_ifnames(struct walkarg *w)
        int error = 0;
 
        /* XXX ignore tableid for now */
-       TAILQ_FOREACH(ifp, &ifnet, if_list) {
+       TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                if (w->w_arg && w->w_arg != ifp->if_index)
                        continue;
                w->w_needed += sizeof(ifn);
diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c
index 9e01ea88870..47ea9310d15 100644
--- a/sys/netinet/igmp.c
+++ b/sys/netinet/igmp.c
@@ -539,7 +539,7 @@ igmp_fasttimo(void)
        NET_LOCK();
 
        igmp_timers_are_running = 0;
-       TAILQ_FOREACH(ifp, &ifnet, if_list)
+       TAILQ_FOREACH(ifp, &ifnetlist, if_list)
                igmp_checktimer(ifp);
 
        NET_UNLOCK();
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index 2ff41a56f9a..7dcb664f163 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -828,7 +828,7 @@ in_broadcast(struct in_addr in, u_int rtableid)
        rdomain = rtable_l2(rtableid);
 
 #define ia (ifatoia(ifa))
-       TAILQ_FOREACH(ifn, &ifnet, if_list) {
+       TAILQ_FOREACH(ifn, &ifnetlist, if_list) {
                if (ifn->if_rdomain != rdomain)
                        continue;
                if ((ifn->if_flags & IFF_BROADCAST) == 0)
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 8cc6fc4e180..a202b885350 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1004,7 +1004,7 @@ carp_send_ad_all(void)
        if (carp_send_all_recur > 0)
                return;
        ++carp_send_all_recur;
-       TAILQ_FOREACH(ifp0, &ifnet, if_list) {
+       TAILQ_FOREACH(ifp0, &ifnetlist, if_list) {
                if (ifp0->if_type != IFT_ETHER)
                        continue;
 
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
index d070bfbf100..f92f930dbe3 100644
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -353,7 +353,7 @@ mrt_sysctl_vif(void *oldp, size_t *oldlenp)
        given = *oldlenp;
        needed = 0;
        memset(&vinfo, 0, sizeof vinfo);
-       TAILQ_FOREACH(ifp, &ifnet, if_list) {
+       TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                if ((vifp = (struct vif *)ifp->if_mcast) == NULL)
                        continue;
 
@@ -560,7 +560,7 @@ ip_mrouter_done(struct socket *so)
        } while (error == EAGAIN);
 
        /* Unregister all interfaces in the domain. */
-       TAILQ_FOREACH(ifp, &ifnet, if_list) {
+       TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                if (ifp->if_rdomain != rtableid)
                        continue;
 
@@ -607,7 +607,7 @@ set_api_config(struct socket *so, struct mbuf *m)
         *  - there are no vifs installed
         *  - the MFC table is empty
         */
-       TAILQ_FOREACH(ifp, &ifnet, if_list) {
+       TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                if (ifp->if_rdomain != rtableid)
                        continue;
                if (ifp->if_mcast == NULL)
@@ -1284,7 +1284,7 @@ if_lookupbyvif(vifi_t vifi, unsigned int rtableid)
        struct vif      *v;
        struct ifnet    *ifp;
 
-       TAILQ_FOREACH(ifp, &ifnet, if_list) {
+       TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                if (ifp->if_rdomain != rtableid)
                        continue;
                if ((v = (struct vif *)ifp->if_mcast) == NULL)
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index 20ff9213535..df5fdde89b2 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -1344,7 +1344,7 @@ in6_ifawithscope(struct ifnet *oifp, struct in6_addr 
*dst, u_int rdomain)
        }
 
        /* We search for all addresses on all interfaces from the beginning. */
-       TAILQ_FOREACH(ifp, &ifnet, if_list) {
+       TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                if (ifp->if_rdomain != rdomain)
                        continue;
 #if NCARP > 0
diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c
index b1ac9c82621..3327c64c0d6 100644
--- a/sys/netinet6/in6_ifattach.c
+++ b/sys/netinet6/in6_ifattach.c
@@ -209,7 +209,7 @@ in6_get_ifid(struct ifnet *ifp0, struct in6_addr *in6)
        }
 
        /* next, try to get it from some other hardware interface */
-       TAILQ_FOREACH(ifp, &ifnet, if_list) {
+       TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                if (ifp == ifp0)
                        continue;
                if (in6_get_hw_ifid(ifp, in6) == 0)
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c
index 161eba669bd..8b628aa657c 100644
--- a/sys/netinet6/ip6_mroute.c
+++ b/sys/netinet6/ip6_mroute.c
@@ -328,7 +328,7 @@ mrt6_sysctl_mif(void *oldp, size_t *oldlenp)
        given = *oldlenp;
        needed = 0;
        memset(&minfo, 0, sizeof minfo);
-       TAILQ_FOREACH(ifp, &ifnet, if_list) {
+       TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                if ((mifp = (struct mif6 *)ifp->if_mcast6) == NULL)
                        continue;
 
@@ -533,7 +533,7 @@ ip6_mrouter_done(struct socket *so)
        } while (error == EAGAIN);
 
        /* Unregister all interfaces in the domain. */
-       TAILQ_FOREACH(ifp, &ifnet, if_list) {
+       TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                if (ifp->if_rdomain != rtableid)
                        continue;
 
@@ -1185,7 +1185,7 @@ mrt6_iflookupbymif(mifi_t mifi, unsigned int rtableid)
        struct mif6     *m6;
        struct ifnet    *ifp;
 
-       TAILQ_FOREACH(ifp, &ifnet, if_list) {
+       TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                if (ifp->if_rdomain != rtableid)
                        continue;
                if ((m6 = (struct mif6 *)ifp->if_mcast6) == NULL)
diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c
index a58009650f7..8c6b438f395 100644
--- a/sys/netinet6/mld6.c
+++ b/sys/netinet6/mld6.c
@@ -340,7 +340,7 @@ mld6_fasttimeo(void)
        NET_LOCK();
 
        mld6_timers_are_running = 0;
-       TAILQ_FOREACH(ifp, &ifnet, if_list)
+       TAILQ_FOREACH(ifp, &ifnetlist, if_list)
                mld6_checktimer(ifp);
 
        NET_UNLOCK();
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 7978935cf5c..80d520ebe86 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -489,7 +489,7 @@ nd6_expire(void *unused)
        KERNEL_LOCK();
        NET_LOCK();
 
-       TAILQ_FOREACH(ifp, &ifnet, if_list) {
+       TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                struct ifaddr *ifa, *nifa;
                struct in6_ifaddr *ia6;
 
@@ -1310,7 +1310,7 @@ nd6_slowtimo(void *ignored_arg)
 
        timeout_add_sec(&nd6_slowtimo_ch, ND6_SLOWTIMER_INTERVAL);
 
-       TAILQ_FOREACH(ifp, &ifnet, if_list) {
+       TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
                nd6if = ND_IFINFO(ifp);
                if (nd6if->basereachable && /* already initialized */
                    (nd6if->recalctm -= ND6_SLOWTIMER_INTERVAL) <= 0) {

Reply via email to