summaryrefslogtreecommitdiffstats
path: root/sys/netgraph
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netgraph')
-rw-r--r--sys/netgraph/atm/ng_atm.c7
-rw-r--r--sys/netgraph/ng_ether.c5
-rw-r--r--sys/netgraph/ng_fec.c1
-rw-r--r--sys/netgraph/ng_gif.c5
-rw-r--r--sys/netgraph/ng_parse.c6
5 files changed, 14 insertions, 10 deletions
diff --git a/sys/netgraph/atm/ng_atm.c b/sys/netgraph/atm/ng_atm.c
index de57bee..dc55a4f 100644
--- a/sys/netgraph/atm/ng_atm.c
+++ b/sys/netgraph/atm/ng_atm.c
@@ -345,6 +345,7 @@ static const struct {
#define IFP2NG(IFP) ((node_p)((struct ifatm *)(IFP))->ngpriv)
+#define IFP2NG_SET(IFP, val) (((struct ifatm *)(IFP))->ngpriv = (val))
#define IFFLAGS "\020\001UP\002BROADCAST\003DEBUG\004LOOPBACK" \
"\005POINTOPOINT\006SMART\007RUNNING\010NOARP" \
@@ -1280,7 +1281,7 @@ ng_atm_attach(struct ifnet *ifp)
NG_NODE_SET_PRIVATE(node, priv);
priv->ifp = ifp;
LIST_INIT(&priv->vccs);
- IFP2NG(ifp) = node;
+ IFP2NG_SET(ifp, node);
if (ng_name_node(node, name) != 0) {
log(LOG_WARNING, "%s: can't name node %s\n",
@@ -1303,7 +1304,7 @@ ng_atm_detach(struct ifnet *ifp)
NG_NODE_REALLY_DIE(node);
priv = NG_NODE_PRIVATE(node);
- IFP2NG(priv->ifp) = NULL;
+ IFP2NG_SET(priv->ifp, NULL);
priv->ifp = NULL;
ng_rmnode_self(node);
@@ -1334,7 +1335,7 @@ ng_atm_shutdown(node_p node)
if (!allow_shutdown)
NG_NODE_REVIVE(node); /* we persist */
else {
- IFP2NG(priv->ifp) = NULL;
+ IFP2NG_SET(priv->ifp, NULL);
NG_NODE_SET_PRIVATE(node, NULL);
free(priv, M_NETGRAPH);
NG_NODE_UNREF(node);
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 */
}
diff --git a/sys/netgraph/ng_fec.c b/sys/netgraph/ng_fec.c
index 1e126f2..39f80aa 100644
--- a/sys/netgraph/ng_fec.c
+++ b/sys/netgraph/ng_fec.c
@@ -134,6 +134,7 @@
* should be unused, so we can use to hold our node context.
*/
#define IFP2NG(ifp) (struct ng_node *)(ifp->if_afdata[AF_NETGRAPH])
+#define IFP2NG_SET(ifp, val) ifp->if_afdata[AF_NETGRAPH] = (val);
#define FEC_INC(x, y) (x) = (x + 1) % y
/*
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 */
}
diff --git a/sys/netgraph/ng_parse.c b/sys/netgraph/ng_parse.c
index 69090bea..4e89c5f 100644
--- a/sys/netgraph/ng_parse.c
+++ b/sys/netgraph/ng_parse.c
@@ -1115,7 +1115,7 @@ ng_bytearray_parse(const struct ng_parse_type *type,
struct ng_parse_type subtype;
subtype = ng_parse_bytearray_subtype;
- (const void *)subtype.private = type->info;
+ *(const void **)&subtype.private = type->info;
return ng_array_parse(&subtype, s, off, start, buf, buflen);
}
}
@@ -1127,7 +1127,7 @@ ng_bytearray_unparse(const struct ng_parse_type *type,
struct ng_parse_type subtype;
subtype = ng_parse_bytearray_subtype;
- (const void *)subtype.private = type->info;
+ *(const void **)&subtype.private = type->info;
return ng_array_unparse(&subtype, data, off, cbuf, cbuflen);
}
@@ -1138,7 +1138,7 @@ ng_bytearray_getDefault(const struct ng_parse_type *type,
struct ng_parse_type subtype;
subtype = ng_parse_bytearray_subtype;
- (const void *)subtype.private = type->info;
+ *(const void **)&subtype.private = type->info;
return ng_array_getDefault(&subtype, start, buf, buflen);
}
OpenPOWER on IntegriCloud