summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_fec.c
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2005-11-04 13:50:38 +0000
committerru <ru@FreeBSD.org>2005-11-04 13:50:38 +0000
commit52caee198230c71e8895ba3639f479f02035678a (patch)
tree344324f81898858444336a36400ec29eeb4bb88f /sys/netgraph/ng_fec.c
parentae161ac2394e00bb3afca0667a13243d7963dfe2 (diff)
downloadFreeBSD-src-52caee198230c71e8895ba3639f479f02035678a.zip
FreeBSD-src-52caee198230c71e8895ba3639f479f02035678a.tar.gz
- Fix another fallout from the if_alloc() conversion:
previously, ifp->if_type was set to IFT_ETHER by ether_ifattach(), now it's done by if_alloc() so an assignment of if_type to IFT_PROPVIRTUAL after if_alloc() but before ether_ifattach() broke it. This makes arp(8) and friends happy about the fec interfaces, and will allow us to use if_setlladdr() on the fec interface. - Set/reset IFF_DRV_RUNNING/IFF_DRV_OACTIVE in init() and stop() methods rather than in ioctl(), like the rest of the drivers do. This fixes a bug when an "ifconfig fec0 ipv4_address" would not have made the interface running, didn't launch the ticker function to track media status of bundled ports, etc.
Diffstat (limited to 'sys/netgraph/ng_fec.c')
-rw-r--r--sys/netgraph/ng_fec.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/netgraph/ng_fec.c b/sys/netgraph/ng_fec.c
index c162453..55da28b 100644
--- a/sys/netgraph/ng_fec.c
+++ b/sys/netgraph/ng_fec.c
@@ -565,6 +565,9 @@ ng_fec_init(void *arg)
p->fec_ifstat = -1;
}
+ ifp->if_drv_flags &= ~(IFF_DRV_OACTIVE);
+ ifp->if_drv_flags |= IFF_DRV_RUNNING;
+
priv->fec_ch = timeout(ng_fec_tick, priv, hz);
return;
@@ -589,6 +592,8 @@ ng_fec_stop(struct ifnet *ifp)
untimeout(ng_fec_tick, priv, priv->fec_ch);
+ ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
+
return;
}
@@ -713,8 +718,6 @@ ng_fec_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
error = EINVAL;
break;
}
- ifp->if_drv_flags &= ~(IFF_DRV_OACTIVE);
- ifp->if_drv_flags |= IFF_DRV_RUNNING;
ng_fec_init(priv);
}
/*
@@ -728,9 +731,7 @@ ng_fec_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
}
} else {
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
- ifp->if_drv_flags &= ~(IFF_DRV_RUNNING |
- IFF_DRV_OACTIVE);
- ng_fec_stop(ifp);
+ ng_fec_stop(ifp);
}
break;
@@ -1133,7 +1134,6 @@ ng_fec_constructor(node_p node)
ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
ifp->if_mtu = NG_FEC_MTU_DEFAULT;
ifp->if_flags = (IFF_SIMPLEX|IFF_BROADCAST|IFF_MULTICAST);
- ifp->if_type = IFT_PROPVIRTUAL; /* XXX */
ifp->if_addrlen = 0; /* XXX */
ifp->if_hdrlen = 0; /* XXX */
ifp->if_baudrate = 100000000; /* XXX */
OpenPOWER on IntegriCloud