diff options
author | Brooks Davis <brooks@FreeBSD.org> | 2005-06-10 16:49:24 +0000 |
---|---|---|
committer | Brooks Davis <brooks@FreeBSD.org> | 2005-06-10 16:49:24 +0000 |
commit | fc74a9f93a5fbc83262aa12084404ac953c854b5 (patch) | |
tree | f65b6d7834b40dfcd48534829a0a1e9529ab87ee /sys/netinet/in_gif.c | |
parent | 7f1d8b7517a6a93379974243551e0ec0a96cb54e (diff) | |
download | src-fc74a9f93a5fbc83262aa12084404ac953c854b5.tar.gz src-fc74a9f93a5fbc83262aa12084404ac953c854b5.zip |
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
Notes
Notes:
svn path=/head/; revision=147256
Diffstat (limited to 'sys/netinet/in_gif.c')
-rw-r--r-- | sys/netinet/in_gif.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/netinet/in_gif.c b/sys/netinet/in_gif.c index d6360b60d5b0..aeed444ee773 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) |