diff options
author | ru <ru@FreeBSD.org> | 2005-11-11 16:04:59 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2005-11-11 16:04:59 +0000 |
commit | f70f525b491a7d4a0a4f60eb7d69095f6f6e12e4 (patch) | |
tree | c961eb29eda0888de8f7fedb7d3eb12e58d687d3 /sys/net/if_fddisubr.c | |
parent | f82904627463e2f13912d433c5855e8bc112a3f3 (diff) | |
download | FreeBSD-src-f70f525b491a7d4a0a4f60eb7d69095f6f6e12e4.zip FreeBSD-src-f70f525b491a7d4a0a4f60eb7d69095f6f6e12e4.tar.gz |
- Store pointer to the link-level address right in "struct ifnet"
rather than in ifindex_table[]; all (except one) accesses are
through ifp anyway. IF_LLADDR() works faster, and all (except
one) ifaddr_byindex() users were converted to use ifp->if_addr.
- Stop storing a (pointer to) Ethernet address in "struct arpcom",
and drop the IFP2ENADDR() macro; all users have been converted
to use IF_LLADDR() instead.
Diffstat (limited to 'sys/net/if_fddisubr.c')
-rw-r--r-- | sys/net/if_fddisubr.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c index 917ed66..d7c3e33 100644 --- a/sys/net/if_fddisubr.c +++ b/sys/net/if_fddisubr.c @@ -309,7 +309,7 @@ fddi_output(ifp, m, dst, rt0) if (hdrcmplt) bcopy((caddr_t)esrc, (caddr_t)fh->fddi_shost, FDDI_ADDR_LEN); else - bcopy(IFP2ENADDR(ifp), (caddr_t)fh->fddi_shost, + bcopy(IF_LLADDR(ifp), (caddr_t)fh->fddi_shost, FDDI_ADDR_LEN); /* @@ -420,7 +420,7 @@ fddi_input(ifp, m) * is in promiscuous mode. */ if ((ifp->if_flags & IFF_PROMISC) && ((fh->fddi_dhost[0] & 1) == 0) && - (bcmp(IFP2ENADDR(ifp), (caddr_t)fh->fddi_dhost, + (bcmp(IF_LLADDR(ifp), (caddr_t)fh->fddi_dhost, FDDI_ADDR_LEN) != 0)) goto dropanyway; @@ -579,17 +579,13 @@ fddi_ifattach(ifp, lla, bpf) #ifdef IFF_NOTRAILERS ifp->if_flags |= IFF_NOTRAILERS; #endif - ifa = ifaddr_byindex(ifp->if_index); - if (ifa == NULL) { - if_printf(ifp, "%s() no lladdr!\n", __func__); - return; - } + ifa = ifp->if_addr; + KASSERT(ifa != NULL, ("%s: no lladdr!\n", __func__)); sdl = (struct sockaddr_dl *)ifa->ifa_addr; sdl->sdl_type = IFT_FDDI; sdl->sdl_alen = ifp->if_addrlen; bcopy(lla, LLADDR(sdl), ifp->if_addrlen); - IFP2ENADDR(ifp) = LLADDR(sdl); if (bpf) bpfattach(ifp, DLT_FDDI, FDDI_HDR_LEN); @@ -647,10 +643,10 @@ fddi_ioctl (ifp, command, data) if (ipx_nullhost(*ina)) { ina->x_host = *(union ipx_host *) - IFP2ENADDR(ifp); + IF_LLADDR(ifp); } else { bcopy((caddr_t) ina->x_host.c_host, - (caddr_t) IFP2ENADDR(ifp), + (caddr_t) IF_LLADDR(ifp), ETHER_ADDR_LEN); } @@ -670,7 +666,7 @@ fddi_ioctl (ifp, command, data) struct sockaddr *sa; sa = (struct sockaddr *) & ifr->ifr_data; - bcopy(IFP2ENADDR(ifp), + bcopy(IF_LLADDR(ifp), (caddr_t) sa->sa_data, FDDI_ADDR_LEN); } |