Don't try to ifpromisc() on an interface that's deleted already.

This commit is contained in:
Brian Feldman 2004-01-09 00:41:45 +00:00
parent 07eacae0d2
commit 018df1c369

View file

@ -597,10 +597,6 @@ ng_ether_shutdown(node_p node)
{
const priv_p priv = NG_NODE_PRIVATE(node);
if (priv->promisc) { /* disable promiscuous mode */
(void)ifpromisc(priv->ifp, 0);
priv->promisc = 0;
}
if (node->nd_flags & NG_REALLY_DIE) {
/*
* WE came here because the ethernet card is being unloaded,
@ -613,6 +609,10 @@ ng_ether_shutdown(node_p node)
NG_NODE_UNREF(node); /* free node itself */
return (0);
}
if (priv->promisc) { /* disable promiscuous mode */
(void)ifpromisc(priv->ifp, 0);
priv->promisc = 0;
}
priv->autoSrcAddr = 1; /* reset auto-src-addr flag */
node->nd_flags &= ~NG_INVALID; /* Signal ng_rmnode we are persisant */
return (0);