MFC: 1.56: Make IFP2NG() usable as lvalue.

This commit is contained in:
ru 2005-11-16 10:33:53 +00:00
parent 539591f019
commit b8108a4f96

View File

@ -69,8 +69,7 @@
#include <netgraph/ng_parse.h>
#include <netgraph/ng_ether.h>
#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 {
@ -304,7 +303,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;
@ -331,7 +330,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 */
}