diff options
author | luigi <luigi@FreeBSD.org> | 2004-04-24 21:59:41 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2004-04-24 21:59:41 +0000 |
commit | 963f4166f4487fc3d9e4868829a2cb7ebfa985bc (patch) | |
tree | 4b0044e31443e925bbb71ef00f4520c732611792 /sys/net | |
parent | 800747333a8939d694a9eb3ff9415a29796c9dcf (diff) | |
download | FreeBSD-src-963f4166f4487fc3d9e4868829a2cb7ebfa985bc.zip FreeBSD-src-963f4166f4487fc3d9e4868829a2cb7ebfa985bc.tar.gz |
arpcom untangling:
- use ifp instead if &ac->ac_if in a couple of nd6* calls;
this removes a useless dependency.
- use IFP2AC(ifp) instead of an extra variable to point to the struct arpcom;
this does not remove the nesting dependency between arpcom and ifnet but
makes it more evident.
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_ethersubr.c | 7 | ||||
-rw-r--r-- | sys/net/if_fddisubr.c | 5 | ||||
-rw-r--r-- | sys/net/if_iso88025subr.c | 5 |
3 files changed, 7 insertions, 10 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 4b10239..ae59947 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -138,7 +138,6 @@ ether_output(struct ifnet *ifp, struct mbuf *m, struct ether_header *eh; int loop_copy = 0; int hlen; /* link layer header length */ - struct arpcom *ac = IFP2AC(ifp); #ifdef MAC error = mac_check_ifnet_transmit(ifp, m); @@ -193,7 +192,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m, #endif #ifdef INET6 case AF_INET6: - if (!nd6_storelladdr(&ac->ac_if, rt, m, dst, (u_char *)edst)) { + if (!nd6_storelladdr(ifp, rt, m, dst, (u_char *)edst)) { /* Something bad happened */ return(0); } @@ -220,7 +219,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m, if ((aa = at_ifawithnet((struct sockaddr_at *)dst)) == NULL) { goto bad; } - if (!aarpresolve(ac, m, (struct sockaddr_at *)dst, edst)) + if (!aarpresolve(IFP2AC(ifp), m, (struct sockaddr_at *)dst, edst)) return (0); /* * In the phase 2 case, need to prepend an mbuf for the llc header. @@ -280,7 +279,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m, (void)memcpy(eh->ether_shost, esrc, sizeof(eh->ether_shost)); else - (void)memcpy(eh->ether_shost, ac->ac_enaddr, + (void)memcpy(eh->ether_shost, IFP2AC(ifp)->ac_enaddr, sizeof(eh->ether_shost)); /* diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c index 0602c43..d9330ee5 100644 --- a/sys/net/if_fddisubr.c +++ b/sys/net/if_fddisubr.c @@ -119,7 +119,6 @@ fddi_output(ifp, m, dst, rt0) u_char esrc[FDDI_ADDR_LEN], edst[FDDI_ADDR_LEN]; struct rtentry *rt; struct fddi_header *fh; - struct arpcom *ac = IFP2AC(ifp); #ifdef MAC error = mac_check_ifnet_transmit(ifp, m); @@ -192,7 +191,7 @@ fddi_output(ifp, m, dst, rt0) #ifdef NETATALK case AF_APPLETALK: { struct at_ifaddr *aa; - if (!aarpresolve(ac, m, (struct sockaddr_at *)dst, edst)) + if (!aarpresolve(IFP2AC(ifp), m, (struct sockaddr_at *)dst, edst)) return (0); /* * ifaddr is the first thing in at_ifaddr @@ -314,7 +313,7 @@ fddi_output(ifp, m, dst, rt0) if (hdrcmplt) bcopy((caddr_t)esrc, (caddr_t)fh->fddi_shost, FDDI_ADDR_LEN); else - bcopy((caddr_t)ac->ac_enaddr, (caddr_t)fh->fddi_shost, + bcopy(IFP2AC(ifp)->ac_enaddr, (caddr_t)fh->fddi_shost, FDDI_ADDR_LEN); /* diff --git a/sys/net/if_iso88025subr.c b/sys/net/if_iso88025subr.c index 5f1b802..72b246f 100644 --- a/sys/net/if_iso88025subr.c +++ b/sys/net/if_iso88025subr.c @@ -246,7 +246,6 @@ iso88025_output(ifp, m, dst, rt0) struct iso88025_header gen_th; struct sockaddr_dl *sdl = NULL; struct rtentry *rt; - struct arpcom *ac = IFP2AC(ifp); #ifdef MAC error = mac_check_ifnet_transmit(ifp, m); @@ -272,7 +271,7 @@ iso88025_output(ifp, m, dst, rt0) /* 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, (caddr_t)ac->ac_enaddr, + (void)memcpy((caddr_t)gen_th.iso88025_shost, IFP2AC(ifp)->ac_enaddr, ISO88025_ADDR_LEN); if (rif_len) { gen_th.iso88025_shost[0] |= TR_RII; @@ -321,7 +320,7 @@ iso88025_output(ifp, m, dst, rt0) #endif /* INET */ #ifdef INET6 case AF_INET6: - if (!nd6_storelladdr(&ac->ac_if, rt, m, dst, (u_char *)edst)) { + if (!nd6_storelladdr(ifp, rt, m, dst, (u_char *)edst)) { /* Something bad happened */ return(0); } |