diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c index 2b702305bf31..484f2a972c49 100644 --- a/sys/netgraph/ng_ether.c +++ b/sys/netgraph/ng_ether.c @@ -68,8 +68,7 @@ #include #include -#define IFP2NG(ifp) ((struct ng_node *)IFP2AC((ifp))->ac_netgraph) -#define IFP2NG_SET(ifp, val) (IFP2AC((ifp))->ac_netgraph = (val)) +#define IFP2NG(ifp) (IFP2AC((ifp))->ac_netgraph) /* Per-node private data */ struct private { @@ -303,7 +302,7 @@ ng_ether_attach(struct ifnet *ifp) } NG_NODE_SET_PRIVATE(node, priv); priv->ifp = ifp; - IFP2NG_SET(ifp, node); + IFP2NG(ifp) = node; priv->autoSrcAddr = 1; priv->hwassist = ifp->if_hwassist; @@ -330,7 +329,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_SET(ifp, NULL); + IFP2NG(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 a4ee15da4f4a..85e2f77fc621 100644 --- a/sys/netgraph/ng_fec.c +++ b/sys/netgraph/ng_fec.c @@ -134,9 +134,7 @@ * family domain. This means the AF_NETGRAPH entry in ifp->if_afdata * 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 +#define IFP2NG(ifp) ((ifp)->if_afdata[AF_NETGRAPH]) /* * Current fast etherchannel implementations use either 2 or 4 @@ -404,7 +402,7 @@ ng_fec_addport(struct ng_fec_private *priv, char *iface) return(ENOMEM); IF_AFDATA_LOCK(bifp); - bifp->if_afdata[AF_NETGRAPH] = priv->node; + IFP2NG(bifp) = priv->node; IF_AFDATA_UNLOCK(bifp); /* @@ -495,7 +493,7 @@ ng_fec_delport(struct ng_fec_private *priv, char *iface) /* Remove our node context pointer. */ IF_AFDATA_LOCK(bifp); - bifp->if_afdata[AF_NETGRAPH] = NULL; + IFP2NG(bifp) = NULL; IF_AFDATA_UNLOCK(bifp); /* Delete port */