summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2005-04-20 12:22:33 +0000
committerglebius <glebius@FreeBSD.org>2005-04-20 12:22:33 +0000
commitaffa08f12617d411928a3d19184e7ed458b8dfd5 (patch)
tree12848acc3c625a73b655dc057953a566d1b6c5fd /sys
parent49b129d962b99a6180eba9f6155e297bb869c1c4 (diff)
downloadFreeBSD-src-affa08f12617d411928a3d19184e7ed458b8dfd5.zip
FreeBSD-src-affa08f12617d411928a3d19184e7ed458b8dfd5.tar.gz
Remove extra ifnet pointer from private data. It can be accessed via arpcom.
Diffstat (limited to 'sys')
-rw-r--r--sys/netgraph/ng_eiface.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/netgraph/ng_eiface.c b/sys/netgraph/ng_eiface.c
index b1e687a..c27dc93 100644
--- a/sys/netgraph/ng_eiface.c
+++ b/sys/netgraph/ng_eiface.c
@@ -74,7 +74,7 @@ static const struct ng_cmdlist ng_eiface_cmdlist[] = {
/* Node private data */
struct ng_eiface_private {
struct arpcom arpcom; /* per-interface network data */
- struct ifnet *ifp; /* This interface */
+#define sc_ifp arpcom.ac_if
int unit; /* Interface unit number */
node_p node; /* Our netgraph node */
hook_p ether; /* Hook for ethernet stream */
@@ -188,7 +188,7 @@ static void
ng_eiface_init(void *xsc)
{
priv_p sc = xsc;
- struct ifnet *ifp = sc->ifp;
+ struct ifnet *ifp = &sc->sc_ifp;
int s;
s = splimp();
@@ -339,7 +339,6 @@ ng_eiface_constructor(node_p node)
/* Link them together */
ifp->if_softc = priv;
- priv->ifp = ifp;
/* Get an interface unit number */
priv->unit = alloc_unr(ng_eiface_unit);
@@ -397,7 +396,7 @@ static int
ng_eiface_rcvmsg(node_p node, item_p item, hook_p lasthook)
{
const priv_p priv = NG_NODE_PRIVATE(node);
- struct ifnet *const ifp = priv->ifp;
+ struct ifnet *const ifp = &priv->sc_ifp;
struct ng_mesg *resp = NULL;
int error = 0;
struct ng_mesg *msg;
@@ -510,7 +509,7 @@ static int
ng_eiface_rcvdata(hook_p hook, item_p item)
{
const priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook));
- struct ifnet *const ifp = priv->ifp;
+ struct ifnet *const ifp = &priv->sc_ifp;
struct mbuf *m;
NGI_GET_M(item, m);
@@ -547,7 +546,7 @@ static int
ng_eiface_rmnode(node_p node)
{
const priv_p priv = NG_NODE_PRIVATE(node);
- struct ifnet *const ifp = priv->ifp;
+ struct ifnet *const ifp = &priv->sc_ifp;
ether_ifdetach(ifp);
free_unr(ng_eiface_unit, priv->unit);
OpenPOWER on IntegriCloud