Date: Wed, 31 Dec 2014 09:44:35 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r276458 - projects/ifnet/sys/net Message-ID: <201412310944.sBV9iZIC039093@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Wed Dec 31 09:44:34 2014 New Revision: 276458 URL: https://svnweb.freebsd.org/changeset/base/276458 Log: - Mechanically convert access to different ifnet fields that moved to ifdriver to inline functions. - Other small changes to adopt to new ifnet world order. Sponsored by: Netflix Sponsored by: Nginx, Inc. Deleted: projects/ifnet/sys/net/if_dead.c Modified: projects/ifnet/sys/net/bpf.c projects/ifnet/sys/net/bridgestp.c projects/ifnet/sys/net/ieee8023ad_lacp.c projects/ifnet/sys/net/if_arcsubr.c projects/ifnet/sys/net/if_bridge.c projects/ifnet/sys/net/if_clone.c projects/ifnet/sys/net/if_clone.h projects/ifnet/sys/net/if_debug.c projects/ifnet/sys/net/if_dl.h projects/ifnet/sys/net/if_fddisubr.c projects/ifnet/sys/net/if_iso88025subr.c projects/ifnet/sys/net/if_lagg.c projects/ifnet/sys/net/if_llatbl.c projects/ifnet/sys/net/if_mib.c projects/ifnet/sys/net/if_tap.c projects/ifnet/sys/net/if_vlan.c projects/ifnet/sys/net/if_vlan_var.h projects/ifnet/sys/net/route.c projects/ifnet/sys/net/rtsock.c Modified: projects/ifnet/sys/net/bpf.c ============================================================================== --- projects/ifnet/sys/net/bpf.c Wed Dec 31 09:41:25 2014 (r276457) +++ projects/ifnet/sys/net/bpf.c Wed Dec 31 09:44:34 2014 (r276458) @@ -1140,13 +1140,13 @@ bpfwrite(struct cdev *dev, struct uio *u BPFD_UNLOCK(d); #endif - error = (*ifp->if_output)(ifp, m, &dst, NULL); + error = if_output(ifp, m, &dst, NULL); if (error) d->bd_wdcount++; if (mc != NULL) { if (error == 0) - (*ifp->if_input)(ifp, mc); + if_input(ifp, mc); else m_freem(mc); } @@ -1330,7 +1330,7 @@ bpfioctl(struct cdev *dev, u_long cmd, c error = EINVAL; else { ifp = d->bd_bif->bif_ifp; - error = (*ifp->if_ioctl)(ifp, cmd, addr); + error = if_ioctl(ifp, cmd, addr); } break; } @@ -2520,10 +2520,7 @@ bpfattach2(struct ifnet *ifp, u_int dlt, { struct bpf_if *bp; - bp = malloc(sizeof(*bp), M_BPF, M_NOWAIT | M_ZERO); - if (bp == NULL) - panic("bpfattach"); - + bp = malloc(sizeof(*bp), M_BPF, M_WAITOK | M_ZERO); LIST_INIT(&bp->bif_dlist); LIST_INIT(&bp->bif_wlist); bp->bif_ifp = ifp; Modified: projects/ifnet/sys/net/bridgestp.c ============================================================================== --- projects/ifnet/sys/net/bridgestp.c Wed Dec 31 09:41:25 2014 (r276457) +++ projects/ifnet/sys/net/bridgestp.c Wed Dec 31 09:44:34 2014 (r276458) @@ -245,7 +245,7 @@ bstp_transmit_tcn(struct bstp_state *bs, eh = mtod(m, struct ether_header *); - memcpy(eh->ether_shost, IF_LLADDR(ifp), ETHER_ADDR_LEN); + memcpy(eh->ether_shost, if_lladdr(ifp), ETHER_ADDR_LEN); memcpy(eh->ether_dhost, bstp_etheraddr, ETHER_ADDR_LEN); eh->ether_type = htons(sizeof(bpdu)); @@ -359,7 +359,7 @@ bstp_send_bpdu(struct bstp_state *bs, st bpdu->cbu_ctl = LLC_UI; bpdu->cbu_protoid = htons(BSTP_PROTO_ID); - memcpy(eh->ether_shost, IF_LLADDR(ifp), ETHER_ADDR_LEN); + memcpy(eh->ether_shost, if_lladdr(ifp), ETHER_ADDR_LEN); memcpy(eh->ether_dhost, bstp_etheraddr, ETHER_ADDR_LEN); switch (bpdu->cbu_bpdutype) { @@ -2047,14 +2047,14 @@ bstp_reinit(struct bstp_state *bs) if (ifp->if_bridge != bridgeptr) continue; /* Not part of our bridge */ - if (bstp_addr_cmp(IF_LLADDR(ifp), llzero) == 0) + if (bstp_addr_cmp(if_lladdr(ifp), llzero) == 0) continue; /* No mac address set */ if (mif == NULL) { mif = ifp; continue; } - if (bstp_addr_cmp(IF_LLADDR(ifp), IF_LLADDR(mif)) < 0) { + if (bstp_addr_cmp(if_lladdr(ifp), if_lladdr(mif)) < 0) { mif = ifp; continue; } @@ -2063,7 +2063,7 @@ bstp_reinit(struct bstp_state *bs) if (mif == NULL) goto disablestp; - e_addr = IF_LLADDR(mif); + e_addr = if_lladdr(mif); bs->bs_bridge_pv.pv_dbridge_id = (((uint64_t)bs->bs_bridge_priority) << 48) | (((uint64_t)e_addr[0]) << 40) | Modified: projects/ifnet/sys/net/ieee8023ad_lacp.c ============================================================================== --- projects/ifnet/sys/net/ieee8023ad_lacp.c Wed Dec 31 09:41:25 2014 (r276457) +++ projects/ifnet/sys/net/ieee8023ad_lacp.c Wed Dec 31 09:44:34 2014 (r276458) @@ -331,7 +331,7 @@ lacp_fill_actorinfo(struct lacp_port *lp info->lip_systemid.lsi_prio = htons(LACP_SYSTEM_PRIO); memcpy(&info->lip_systemid.lsi_mac, - IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); + if_lladdr(sc->sc_ifp), ETHER_ADDR_LEN); info->lip_portid.lpi_prio = htons(LACP_PORT_PRIO); info->lip_portid.lpi_portno = htons(lp->lp_ifp->if_index); info->lip_state = lp->lp_state; Modified: projects/ifnet/sys/net/if_arcsubr.c ============================================================================== --- projects/ifnet/sys/net/if_arcsubr.c Wed Dec 31 09:41:25 2014 (r276457) +++ projects/ifnet/sys/net/if_arcsubr.c Wed Dec 31 09:44:34 2014 (r276458) @@ -84,7 +84,7 @@ static int arc_resolvemulti(struct ifnet u_int8_t arcbroadcastaddr = 0; -#define ARC_LLADDR(ifp) (*(u_int8_t *)IF_LLADDR(ifp)) +#define ARC_LLADDR(ifp) (*(u_int8_t *)if_lladdr(ifp)) #define senderr(e) { error = (e); goto bad;} #define SIN(s) ((const struct sockaddr_in *)(s)) Modified: projects/ifnet/sys/net/if_bridge.c ============================================================================== --- projects/ifnet/sys/net/if_bridge.c Wed Dec 31 09:41:25 2014 (r276457) +++ projects/ifnet/sys/net/if_bridge.c Wed Dec 31 09:44:34 2014 (r276458) @@ -690,7 +690,7 @@ bridge_clone_create(struct if_clone *ifc LIST_FOREACH(sc2, &V_bridge_list, sc_list) { bifp = sc2->sc_ifp; if (memcmp(sc->sc_defaddr, - IF_LLADDR(bifp), ETHER_ADDR_LEN) == 0) { + if_lladdr(bifp), ETHER_ADDR_LEN) == 0) { retry = 1; break; } @@ -1009,12 +1009,12 @@ bridge_delete_member(struct bridge_softc if (V_bridge_inherit_mac && sc->sc_ifaddr == ifs) { if (LIST_EMPTY(&sc->sc_iflist)) { bcopy(sc->sc_defaddr, - IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); + if_lladdr(sc->sc_ifp), ETHER_ADDR_LEN); sc->sc_ifaddr = NULL; } else { fif = LIST_FIRST(&sc->sc_iflist)->bif_ifp; - bcopy(IF_LLADDR(fif), - IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); + bcopy(if_lladdr(fif), + if_lladdr(sc->sc_ifp), ETHER_ADDR_LEN); sc->sc_ifaddr = fif; } EVENTHANDLER_INVOKE(iflladdr_event, sc->sc_ifp); @@ -1173,8 +1173,8 @@ bridge_ioctl_add(struct bridge_softc *sc * the default randomly generated one. */ if (V_bridge_inherit_mac && LIST_EMPTY(&sc->sc_iflist) && - !memcmp(IF_LLADDR(sc->sc_ifp), sc->sc_defaddr, ETHER_ADDR_LEN)) { - bcopy(IF_LLADDR(ifs), IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); + !memcmp(if_lladdr(sc->sc_ifp), sc->sc_defaddr, ETHER_ADDR_LEN)) { + bcopy(if_lladdr(ifs), if_lladdr(sc->sc_ifp), ETHER_ADDR_LEN); sc->sc_ifaddr = ifs; EVENTHANDLER_INVOKE(iflladdr_event, sc->sc_ifp); } @@ -2396,7 +2396,7 @@ bridge_input(struct ifnet *ifp, struct m if ((iface)->if_type == IFT_GIF) \ continue; \ /* It is destined for us. */ \ - if (memcmp(IF_LLADDR((iface)), eh->ether_dhost, ETHER_ADDR_LEN) == 0 \ + if (memcmp(if_lladdr((iface)), eh->ether_dhost, ETHER_ADDR_LEN) == 0 \ OR_CARP_CHECK_WE_ARE_DST((iface)) \ ) { \ if ((iface)->if_type == IFT_BRIDGE) { \ @@ -2430,7 +2430,7 @@ bridge_input(struct ifnet *ifp, struct m } \ \ /* We just received a packet that we sent out. */ \ - if (memcmp(IF_LLADDR((iface)), eh->ether_shost, ETHER_ADDR_LEN) == 0 \ + if (memcmp(if_lladdr((iface)), eh->ether_shost, ETHER_ADDR_LEN) == 0 \ OR_CARP_CHECK_WE_ARE_SRC((iface)) \ ) { \ BRIDGE_UNLOCK(sc); \ Modified: projects/ifnet/sys/net/if_clone.c ============================================================================== --- projects/ifnet/sys/net/if_clone.c Wed Dec 31 09:41:25 2014 (r276457) +++ projects/ifnet/sys/net/if_clone.c Wed Dec 31 09:44:34 2014 (r276458) @@ -257,7 +257,7 @@ if_clone_destroy(const char *name) /* Find the cloner for this interface */ IF_CLONERS_LOCK(); LIST_FOREACH(ifc, &V_if_cloners, ifc_list) { - if (strcmp(ifc->ifc_name, ifp->if_dname) == 0) { + if (strcmp(ifc->ifc_name, ifp->if_drv->ifdrv_dname) == 0) { break; } } Modified: projects/ifnet/sys/net/if_clone.h ============================================================================== --- projects/ifnet/sys/net/if_clone.h Wed Dec 31 09:41:25 2014 (r276457) +++ projects/ifnet/sys/net/if_clone.h Wed Dec 31 09:44:34 2014 (r276458) @@ -40,10 +40,10 @@ struct if_clone; /* Methods. */ typedef int ifc_match_t(struct if_clone *, const char *); typedef int ifc_create_t(struct if_clone *, char *, size_t, caddr_t); -typedef int ifc_destroy_t(struct if_clone *, struct ifnet *); +typedef int ifc_destroy_t(struct if_clone *, if_t); typedef int ifcs_create_t(struct if_clone *, int, caddr_t); -typedef void ifcs_destroy_t(struct ifnet *); +typedef void ifcs_destroy_t(if_t); /* Interface cloner (de)allocating functions. */ struct if_clone * @@ -71,7 +71,7 @@ int if_clone_destroy(const char *); int if_clone_list(struct if_clonereq *); /* The below interface used only by epair(4). */ -int if_clone_destroyif(struct if_clone *, struct ifnet *); +int if_clone_destroyif(struct if_clone *, if_t); #endif /* _KERNEL */ #endif /* !_NET_IF_CLONE_H_ */ Modified: projects/ifnet/sys/net/if_debug.c ============================================================================== --- projects/ifnet/sys/net/if_debug.c Wed Dec 31 09:41:25 2014 (r276457) +++ projects/ifnet/sys/net/if_debug.c Wed Dec 31 09:44:34 2014 (r276458) @@ -43,10 +43,7 @@ __FBSDID("$FreeBSD$"); #include <net/vnet.h> #ifdef DDB -struct ifindex_entry { - struct ifnet *ife_ifnet; -}; -VNET_DECLARE(struct ifindex_entry *, ifindex_table); +VNET_DECLARE(struct ifnet **, ifindex_table); #define V_ifindex_table VNET(ifindex_table) static void @@ -55,9 +52,9 @@ if_show_ifnet(struct ifnet *ifp) if (ifp == NULL) return; + /* XXXGL: this function needs rewrite. */ db_printf("%s:\n", ifp->if_xname); #define IF_DB_PRINTF(f, e) db_printf(" %s = " f "\n", #e, ifp->e); - IF_DB_PRINTF("%s", if_dname); IF_DB_PRINTF("%d", if_dunit); IF_DB_PRINTF("%s", if_description); IF_DB_PRINTF("%u", if_index); @@ -112,7 +109,7 @@ DB_SHOW_ALL_COMMAND(ifnets, db_show_all_ db_printf("vnet=%p\n", curvnet); #endif for (idx = 1; idx <= V_if_index; idx++) { - ifp = V_ifindex_table[idx].ife_ifnet; + ifp = V_ifindex_table[idx]; if (ifp == NULL) continue; db_printf( "%20s ifp=%p\n", ifp->if_xname, ifp); Modified: projects/ifnet/sys/net/if_dl.h ============================================================================== --- projects/ifnet/sys/net/if_dl.h Wed Dec 31 09:41:25 2014 (r276457) +++ projects/ifnet/sys/net/if_dl.h Wed Dec 31 09:44:34 2014 (r276458) @@ -66,7 +66,7 @@ struct sockaddr_dl { contains both if name and ll address */ }; -#define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen)) +#define LLADDR(s) ((char *)((s)->sdl_data + (s)->sdl_nlen)) #define LLINDEX(s) ((s)->sdl_index) Modified: projects/ifnet/sys/net/if_fddisubr.c ============================================================================== --- projects/ifnet/sys/net/if_fddisubr.c Wed Dec 31 09:41:25 2014 (r276457) +++ projects/ifnet/sys/net/if_fddisubr.c Wed Dec 31 09:44:34 2014 (r276458) @@ -259,7 +259,7 @@ fddi_output(struct ifnet *ifp, struct mb if (hdrcmplt) bcopy((caddr_t)esrc, (caddr_t)fh->fddi_shost, FDDI_ADDR_LEN); else - bcopy(IF_LLADDR(ifp), (caddr_t)fh->fddi_shost, + bcopy(if_lladdr(ifp), (caddr_t)fh->fddi_shost, FDDI_ADDR_LEN); /* @@ -369,7 +369,7 @@ fddi_input(ifp, m) * is in promiscuous mode. */ if ((ifp->if_flags & IFF_PROMISC) && ((fh->fddi_dhost[0] & 1) == 0) && - (bcmp(IF_LLADDR(ifp), (caddr_t)fh->fddi_dhost, + (bcmp(if_lladdr(ifp), (caddr_t)fh->fddi_dhost, FDDI_ADDR_LEN) != 0)) goto dropanyway; @@ -561,7 +561,7 @@ fddi_ioctl (ifp, command, data) struct sockaddr *sa; sa = (struct sockaddr *) & ifr->ifr_data; - bcopy(IF_LLADDR(ifp), + bcopy(if_lladdr(ifp), (caddr_t) sa->sa_data, FDDI_ADDR_LEN); } Modified: projects/ifnet/sys/net/if_iso88025subr.c ============================================================================== --- projects/ifnet/sys/net/if_iso88025subr.c Wed Dec 31 09:41:25 2014 (r276457) +++ projects/ifnet/sys/net/if_iso88025subr.c Wed Dec 31 09:44:34 2014 (r276458) @@ -175,7 +175,7 @@ iso88025_ioctl(struct ifnet *ifp, u_long struct sockaddr *sa; sa = (struct sockaddr *) & ifr->ifr_data; - bcopy(IF_LLADDR(ifp), + bcopy(if_lladdr(ifp), (caddr_t) sa->sa_data, ISO88025_ADDR_LEN); } break; @@ -243,7 +243,7 @@ iso88025_output(struct ifnet *ifp, struc /* Generate a generic 802.5 header for the packet */ gen_th.ac = TR_AC; gen_th.fc = TR_LLC_FRAME; - (void)memcpy((caddr_t)gen_th.iso88025_shost, IF_LLADDR(ifp), + (void)memcpy((caddr_t)gen_th.iso88025_shost, if_lladdr(ifp), ISO88025_ADDR_LEN); if (rif_len) { gen_th.iso88025_shost[0] |= TR_RII; @@ -466,7 +466,7 @@ iso88025_input(ifp, m) */ if ((ifp->if_flags & IFF_PROMISC) && ((th->iso88025_dhost[0] & 1) == 0) && - (bcmp(IF_LLADDR(ifp), (caddr_t) th->iso88025_dhost, + (bcmp(if_lladdr(ifp), (caddr_t) th->iso88025_dhost, ISO88025_ADDR_LEN) != 0)) goto dropanyway; @@ -576,7 +576,7 @@ iso88025_input(ifp, m) l->llc_dsap = l->llc_ssap; l->llc_ssap = c; if (m->m_flags & (M_BCAST | M_MCAST)) - bcopy((caddr_t)IF_LLADDR(ifp), + bcopy((caddr_t)if_lladdr(ifp), (caddr_t)th->iso88025_dhost, ISO88025_ADDR_LEN); sa.sa_family = AF_UNSPEC; Modified: projects/ifnet/sys/net/if_lagg.c ============================================================================== --- projects/ifnet/sys/net/if_lagg.c Wed Dec 31 09:41:25 2014 (r276457) +++ projects/ifnet/sys/net/if_lagg.c Wed Dec 31 09:44:34 2014 (r276458) @@ -572,7 +572,7 @@ lagg_lladdr(struct lagg_softc *sc, uint8 struct ifnet *ifp = sc->sc_ifp; struct lagg_port lp; - if (memcmp(lladdr, IF_LLADDR(ifp), ETHER_ADDR_LEN) == 0) + if (memcmp(lladdr, if_lladdr(ifp), ETHER_ADDR_LEN) == 0) return; LAGG_WLOCK_ASSERT(sc); @@ -583,7 +583,7 @@ lagg_lladdr(struct lagg_softc *sc, uint8 * may trigger gratuitous ARPs for INET will be handled in * a taskqueue. */ - bcopy(lladdr, IF_LLADDR(ifp), ETHER_ADDR_LEN); + bcopy(lladdr, if_lladdr(ifp), ETHER_ADDR_LEN); lagg_proto_lladdr(sc); bzero(&lp, sizeof(lp)); @@ -644,7 +644,7 @@ lagg_port_lladdr(struct lagg_port *lp, u primary = (sc->sc_primary->lp_ifp == ifp) ? 1 : 0; if (primary == 0 && (lp->lp_detaching || - memcmp(lladdr, IF_LLADDR(ifp), ETHER_ADDR_LEN) == 0)) + memcmp(lladdr, if_lladdr(ifp), ETHER_ADDR_LEN) == 0)) return; /* Check to make sure its not already queued to be changed */ @@ -789,14 +789,14 @@ lagg_port_create(struct lagg_softc *sc, lp->lp_softc = sc; /* Save port link layer address */ - bcopy(IF_LLADDR(ifp), lp->lp_lladdr, ETHER_ADDR_LEN); + bcopy(if_lladdr(ifp), lp->lp_lladdr, ETHER_ADDR_LEN); if (SLIST_EMPTY(&sc->sc_ports)) { sc->sc_primary = lp; - lagg_lladdr(sc, IF_LLADDR(ifp)); + lagg_lladdr(sc, if_lladdr(ifp)); } else { /* Update link layer address for this port */ - lagg_port_lladdr(lp, IF_LLADDR(sc->sc_ifp)); + lagg_port_lladdr(lp, if_lladdr(sc->sc_ifp)); } /* Insert into the list of ports. Keep ports sorted by if_index. */ @@ -1156,7 +1156,7 @@ lagg_init(void *xsc) ifp->if_drv_flags |= IFF_DRV_RUNNING; /* Update the port lladdrs */ SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) - lagg_port_lladdr(lp, IF_LLADDR(ifp)); + lagg_port_lladdr(lp, if_lladdr(ifp)); lagg_proto_init(sc); Modified: projects/ifnet/sys/net/if_llatbl.c ============================================================================== --- projects/ifnet/sys/net/if_llatbl.c Wed Dec 31 09:41:25 2014 (r276457) +++ projects/ifnet/sys/net/if_llatbl.c Wed Dec 31 09:44:34 2014 (r276458) @@ -324,7 +324,7 @@ lla_rt_output(struct rt_msghdr *rtm, str * "arp add" should look up this entry, reset the * LLE_DELETED flag, and reset the expiration timer */ - bcopy(LLADDR(dl), &lle->ll_addr, ifp->if_addrlen); + bcopy(LLADDR(dl), &lle->ll_addr, if_addrlen(ifp)); lle->la_flags |= (flags & LLE_PUB); lle->la_flags |= LLE_VALID; lle->la_flags &= ~LLE_DELETED; Modified: projects/ifnet/sys/net/if_mib.c ============================================================================== --- projects/ifnet/sys/net/if_mib.c Wed Dec 31 09:41:25 2014 (r276457) +++ projects/ifnet/sys/net/if_mib.c Wed Dec 31 09:44:34 2014 (r276458) @@ -105,8 +105,7 @@ sysctl_ifdata(SYSCTL_HANDLER_ARGS) /* XX ifmd.ifmd_flags = ifp->if_flags | ifp->if_drv_flags; ifmd.ifmd_snd_len = ifp->if_snd.ifq_len; ifmd.ifmd_snd_maxlen = ifp->if_snd.ifq_maxlen; - ifmd.ifmd_snd_drops = - ifp->if_get_counter(ifp, IFCOUNTER_OQDROPS); + ifmd.ifmd_snd_drops = if_get_counter(ifp, IFCOUNTER_OQDROPS); error = SYSCTL_OUT(req, &ifmd, sizeof ifmd); if (error) @@ -125,15 +124,16 @@ sysctl_ifdata(SYSCTL_HANDLER_ARGS) /* XX case IFDATA_DRIVERNAME: /* 20 is enough for 64bit ints */ - dlen = strlen(ifp->if_dname) + 20 + 1; + dlen = strlen(ifp->if_drv->ifdrv_dname) + 20 + 1; if ((dbuf = malloc(dlen, M_TEMP, M_NOWAIT)) == NULL) { error = ENOMEM; goto out; } if (ifp->if_dunit == IF_DUNIT_NONE) - strcpy(dbuf, ifp->if_dname); + strcpy(dbuf, ifp->if_drv->ifdrv_dname); else - sprintf(dbuf, "%s%d", ifp->if_dname, ifp->if_dunit); + sprintf(dbuf, "%s%d", ifp->if_drv->ifdrv_dname, + ifp->if_dunit); error = SYSCTL_OUT(req, dbuf, strlen(dbuf) + 1); if (error == 0 && req->newptr != NULL) Modified: projects/ifnet/sys/net/if_tap.c ============================================================================== --- projects/ifnet/sys/net/if_tap.c Wed Dec 31 09:41:25 2014 (r276457) +++ projects/ifnet/sys/net/if_tap.c Wed Dec 31 09:44:34 2014 (r276458) @@ -500,7 +500,7 @@ tapopen(struct cdev *dev, int flag, int return (EBUSY); } - bcopy(IF_LLADDR(tp->tap_ifp), tp->ether_addr, sizeof(tp->ether_addr)); + bcopy(if_lladdr(tp->tap_ifp), tp->ether_addr, sizeof(tp->ether_addr)); tp->tap_pid = td->td_proc->p_pid; tp->tap_flags |= TAP_OPEN; ifp = tp->tap_ifp; @@ -970,7 +970,7 @@ tapwrite(struct cdev *dev, struct uio *u if (eh && (ifp->if_flags & IFF_PROMISC) == 0 && !ETHER_IS_MULTICAST(eh->ether_dhost) && - bcmp(eh->ether_dhost, IF_LLADDR(ifp), ETHER_ADDR_LEN) != 0) { + bcmp(eh->ether_dhost, if_lladdr(ifp), ETHER_ADDR_LEN) != 0) { m_freem(m); return (0); } Modified: projects/ifnet/sys/net/if_vlan.c ============================================================================== --- projects/ifnet/sys/net/if_vlan.c Wed Dec 31 09:41:25 2014 (r276457) +++ projects/ifnet/sys/net/if_vlan.c Wed Dec 31 09:44:34 2014 (r276458) @@ -552,7 +552,7 @@ vlan_iflladdr(void *arg __unused, struct LIST_FOREACH_SAFE(ifv, &ifp->if_vlantrunk->hash[i], ifv_list, next) { #endif /* VLAN_ARRAY */ VLAN_UNLOCK(); - if_setlladdr(ifv->ifv_ifp, IF_LLADDR(ifp), + if_setlladdr(ifv->ifv_ifp, if_lladdr(ifp), ifp->if_addrlen); VLAN_LOCK(); } @@ -1342,7 +1342,7 @@ exists: * Set up our interface address to reflect the underlying * physical interface's. */ - bcopy(IF_LLADDR(p), IF_LLADDR(ifp), p->if_addrlen); + bcopy(if_lladdr(p), if_lladdr(ifp), p->if_addrlen); ((struct sockaddr_dl *)ifp->if_addr->ifa_addr)->sdl_alen = p->if_addrlen; @@ -1643,7 +1643,7 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd struct sockaddr *sa; sa = (struct sockaddr *)&ifr->ifr_data; - bcopy(IF_LLADDR(ifp), sa->sa_data, ifp->if_addrlen); + bcopy(if_lladdr(ifp), sa->sa_data, ifp->if_addrlen); } break; case SIOCGIFMEDIA: Modified: projects/ifnet/sys/net/if_vlan_var.h ============================================================================== --- projects/ifnet/sys/net/if_vlan_var.h Wed Dec 31 09:41:25 2014 (r276457) +++ projects/ifnet/sys/net/if_vlan_var.h Wed Dec 31 09:44:34 2014 (r276458) @@ -110,11 +110,6 @@ struct vlanreq { * if_capabilities. */ -#define VLAN_CAPABILITIES(_ifp) do { \ - if ((_ifp)->if_vlantrunk != NULL) \ - (*vlan_trunk_cap_p)(_ifp); \ -} while (0) - #define VLAN_TRUNKDEV(_ifp) \ (_ifp)->if_type == IFT_L2VLAN ? (*vlan_trunkdev_p)((_ifp)) : NULL #define VLAN_TAG(_ifp, _vid) \ Modified: projects/ifnet/sys/net/route.c ============================================================================== --- projects/ifnet/sys/net/route.c Wed Dec 31 09:41:25 2014 (r276457) +++ projects/ifnet/sys/net/route.c Wed Dec 31 09:44:34 2014 (r276458) @@ -1862,8 +1862,8 @@ rtinit1(struct ifaddr *ifa, int cmd, int * doing this for compatibility reasons */ if (cmd == RTM_ADD) { - ((struct sockaddr_dl *)rt->rt_gateway)->sdl_type = - rt->rt_ifp->if_type; + ((struct sockaddr_dl *)rt->rt_gateway)->sdl_type = + if_type(rt->rt_ifp); ((struct sockaddr_dl *)rt->rt_gateway)->sdl_index = rt->rt_ifp->if_index; } Modified: projects/ifnet/sys/net/rtsock.c ============================================================================== --- projects/ifnet/sys/net/rtsock.c Wed Dec 31 09:41:25 2014 (r276457) +++ projects/ifnet/sys/net/rtsock.c Wed Dec 31 09:44:34 2014 (r276458) @@ -749,7 +749,7 @@ route_output(struct mbuf *m, struct sock struct sockaddr laddr; if (rt->rt_ifp != NULL && - rt->rt_ifp->if_type == IFT_PROPVIRTUAL) { + if_type(rt->rt_ifp) == IFT_PROPVIRTUAL) { struct ifaddr *ifa; ifa = ifa_ifwithnet(info.rti_info[RTAX_DST], 1,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412310944.sBV9iZIC039093>