summaryrefslogtreecommitdiffstats
path: root/sys/dev/msk
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2009-05-25 08:02:05 +0000
committeryongari <yongari@FreeBSD.org>2009-05-25 08:02:05 +0000
commit0d707b2fe21f8b1297a2aa1bd787d3beb91fa455 (patch)
tree7581d0b94102ae5d9add105fd2b7b44d8b2641d5 /sys/dev/msk
parentaa6ac0af19b20a22eb813cdc18dfb1077a00c8b6 (diff)
downloadFreeBSD-src-0d707b2fe21f8b1297a2aa1bd787d3beb91fa455.zip
FreeBSD-src-0d707b2fe21f8b1297a2aa1bd787d3beb91fa455.tar.gz
Simplify SIOCSIFFLAGS handler.
Diffstat (limited to 'sys/dev/msk')
-rw-r--r--sys/dev/msk/if_msk.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/sys/dev/msk/if_msk.c b/sys/dev/msk/if_msk.c
index 45c42fb..112b970 100644
--- a/sys/dev/msk/if_msk.c
+++ b/sys/dev/msk/if_msk.c
@@ -957,18 +957,14 @@ msk_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
case SIOCSIFFLAGS:
MSK_IF_LOCK(sc_if);
if ((ifp->if_flags & IFF_UP) != 0) {
- if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
- if (((ifp->if_flags ^ sc_if->msk_if_flags)
- & (IFF_PROMISC | IFF_ALLMULTI)) != 0)
- msk_rxfilter(sc_if);
- } else {
- if ((sc_if->msk_flags & MSK_FLAG_DETACH) == 0)
- msk_init_locked(sc_if);
- }
- } else {
- if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
- msk_stop(sc_if);
- }
+ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 &&
+ ((ifp->if_flags ^ sc_if->msk_if_flags) &
+ (IFF_PROMISC | IFF_ALLMULTI)) != 0)
+ msk_rxfilter(sc_if);
+ else if ((sc_if->msk_flags & MSK_FLAG_DETACH) == 0)
+ msk_init_locked(sc_if);
+ } else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
+ msk_stop(sc_if);
sc_if->msk_if_flags = ifp->if_flags;
MSK_IF_UNLOCK(sc_if);
break;
OpenPOWER on IntegriCloud