From 567ba9b00a248431e7c1147c4e079fd7a11b9ecf Mon Sep 17 00:00:00 2001 From: brooks Date: Fri, 10 Jun 2005 16:49:24 +0000 Subject: Stop embedding struct ifnet at the top of driver softcs. Instead the struct ifnet or the layer 2 common structure it was embedded in have been replaced with a struct ifnet pointer to be filled by a call to the new function, if_alloc(). The layer 2 common structure is also allocated via if_alloc() based on the interface type. It is hung off the new struct ifnet member, if_l2com. This change removes the size of these structures from the kernel ABI and will allow us to better manage them as interfaces come and go. Other changes of note: - Struct arpcom is no longer referenced in normal interface code. Instead the Ethernet address is accessed via the IFP2ENADDR() macro. To enforce this ac_enaddr has been renamed to _ac_enaddr. - The second argument to ether_ifattach is now always the mac address from driver private storage rather than sometimes being ac_enaddr. Reviewed by: sobomax, sam --- sys/netinet/in_gif.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sys/netinet/in_gif.c') diff --git a/sys/netinet/in_gif.c b/sys/netinet/in_gif.c index d6360b6..aeed444 100644 --- a/sys/netinet/in_gif.c +++ b/sys/netinet/in_gif.c @@ -92,7 +92,7 @@ in_gif_output(ifp, family, m) int family; struct mbuf *m; { - struct gif_softc *sc = (struct gif_softc*)ifp; + struct gif_softc *sc = ifp->if_softc; struct sockaddr_in *dst = (struct sockaddr_in *)&sc->gif_ro.ro_dst; struct sockaddr_in *sin_src = (struct sockaddr_in *)sc->gif_psrc; struct sockaddr_in *sin_dst = (struct sockaddr_in *)sc->gif_pdst; @@ -186,7 +186,7 @@ in_gif_output(ifp, family, m) sc->gif_ro.ro_rt = NULL; } #if 0 - sc->gif_if.if_mtu = GIF_MTU; + GIF2IFP(sc)->if_mtu = GIF_MTU; #endif } @@ -210,7 +210,7 @@ in_gif_output(ifp, family, m) error = ip_output(m, NULL, &sc->gif_ro, 0, NULL, NULL); - if (!(sc->gif_if.if_flags & IFF_LINK0) && + if (!(GIF2IFP(sc)->if_flags & IFF_LINK0) && sc->gif_ro.ro_rt != NULL) { RTFREE(sc->gif_ro.ro_rt); sc->gif_ro.ro_rt = NULL; @@ -337,7 +337,7 @@ gif_validate4(ip, sc, ifp) } /* ingress filters on outer source */ - if ((sc->gif_if.if_flags & IFF_LINK2) == 0 && ifp) { + if ((GIF2IFP(sc)->if_flags & IFF_LINK2) == 0 && ifp) { struct sockaddr_in sin; struct rtentry *rt; @@ -349,7 +349,7 @@ gif_validate4(ip, sc, ifp) if (!rt || rt->rt_ifp != ifp) { #if 0 log(LOG_WARNING, "%s: packet from 0x%x dropped " - "due to ingress filter\n", if_name(&sc->gif_if), + "due to ingress filter\n", if_name(GIF2IFP(sc)), (u_int32_t)ntohl(sin.sin_addr.s_addr)); #endif if (rt) -- cgit v1.1