summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_gif.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_gif.c
parentf70e41029a11381a7a06fea43eb09cc0db652143 (diff)
downloadFreeBSD-src-3140931e1f4468fc877cdf58192a63cbb525fc7c.zip
FreeBSD-src-3140931e1f4468fc877cdf58192a63cbb525fc7c.tar.gz
Avoid casts as lvalues.
Diffstat (limited to 'sys/netgraph/ng_gif.c')
-rw-r--r--sys/netgraph/ng_gif.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/netgraph/ng_gif.c b/sys/netgraph/ng_gif.c
index 3ecd852..fa54cd2 100644
--- a/sys/netgraph/ng_gif.c
+++ b/sys/netgraph/ng_gif.c
@@ -88,6 +88,7 @@
#include <netgraph/ng_gif.h>
#define IFP2NG(ifp) ((struct ng_node *)((struct gif_softc *)(ifp))->gif_netgraph)
+#define IFP2NG_SET(ifp, val) (((struct gif_softc *)(ifp))->gif_netgraph = (val))
/* Per-node private data */
struct private {
@@ -247,7 +248,7 @@ ng_gif_attach(struct ifnet *ifp)
}
NG_NODE_SET_PRIVATE(node, priv);
priv->ifp = ifp;
- IFP2NG(ifp) = node;
+ IFP2NG_SET(ifp, node);
/* Try to give the node the same name as the interface */
if (ng_name_node(node, ifp->if_xname) != 0) {
@@ -275,7 +276,7 @@ ng_gif_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