summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_ether.c
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2004-07-28 06:59:55 +0000
committerkan <kan@FreeBSD.org>2004-07-28 06:59:55 +0000
commit3140931e1f4468fc877cdf58192a63cbb525fc7c (patch)
treef5a1d1e036ff3b1d82ae6564771ad7253a6da5d5 /sys/netgraph/ng_ether.c
parentf70e41029a11381a7a06fea43eb09cc0db652143 (diff)
downloadFreeBSD-src-3140931e1f4468fc877cdf58192a63cbb525fc7c.zip
FreeBSD-src-3140931e1f4468fc877cdf58192a63cbb525fc7c.tar.gz
Avoid casts as lvalues.
Diffstat (limited to 'sys/netgraph/ng_ether.c')
-rw-r--r--sys/netgraph/ng_ether.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c
index c997278..3000b7e 100644
--- a/sys/netgraph/ng_ether.c
+++ b/sys/netgraph/ng_ether.c
@@ -65,6 +65,7 @@
#include <netgraph/ng_ether.h>
#define IFP2NG(ifp) ((struct ng_node *)((struct arpcom *)(ifp))->ac_netgraph)
+#define IFP2NG_SET(ifp, val) (((struct arpcom *)(ifp))->ac_netgraph = (val))
/* Per-node private data */
struct private {
@@ -276,7 +277,7 @@ ng_ether_attach(struct ifnet *ifp)
}
NG_NODE_SET_PRIVATE(node, priv);
priv->ifp = ifp;
- IFP2NG(ifp) = node;
+ IFP2NG_SET(ifp, node);
priv->autoSrcAddr = 1;
priv->hwassist = ifp->if_hwassist;
@@ -305,7 +306,7 @@ ng_ether_detach(struct ifnet *ifp)
* So zap it now. XXX We HOPE that anything running at this time
* handles it (as it should in the non netgraph case).
*/
- IFP2NG(ifp) = NULL;
+ IFP2NG_SET(ifp, NULL);
priv->ifp = NULL; /* XXX race if interrupted an output packet */
ng_rmnode_self(node); /* remove all netgraph parts */
}
OpenPOWER on IntegriCloud