summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_fec.c
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2005-11-09 13:34:43 +0000
committerru <ru@FreeBSD.org>2005-11-09 13:34:43 +0000
commit862d9807dd32df55901c71382c54c1537618119e (patch)
tree7eba387e3a1ea1d50ba07cff931ea06670d7c467 /sys/netgraph/ng_fec.c
parentdcace5669d81e83aea7a22539593b0f158eb224c (diff)
downloadFreeBSD-src-862d9807dd32df55901c71382c54c1537618119e.zip
FreeBSD-src-862d9807dd32df55901c71382c54c1537618119e.tar.gz
Make IFP2NG() usable as an lvalue.
Diffstat (limited to 'sys/netgraph/ng_fec.c')
-rw-r--r--sys/netgraph/ng_fec.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/netgraph/ng_fec.c b/sys/netgraph/ng_fec.c
index a4ee15d..85e2f77 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 */
OpenPOWER on IntegriCloud