From 5d6dfbbb5ecfba9d5ac924b274df43db1c3bc980 Mon Sep 17 00:00:00 2001 From: Luigi Rizzo Date: Mon, 25 Nov 2002 19:28:01 +0000 Subject: Fix handling of IFF_ALLMULTI. The same bug in various forms affects the following drivers: dc mn sf sk ste ti tl xl an bge em gem gx ie lge sr aue cue kue wi xe Approved by: re --- sys/dev/dc/if_dc.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'sys/dev/dc') diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c index 7047261f88124..6b2d86c0cf21d 100644 --- a/sys/dev/dc/if_dc.c +++ b/sys/dev/dc/if_dc.c @@ -3539,15 +3539,13 @@ dc_ioctl(ifp, command, data) switch(command) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && - ifp->if_flags & IFF_PROMISC && - !(sc->dc_if_flags & IFF_PROMISC)) { - dc_setfilt(sc); - } else if (ifp->if_flags & IFF_RUNNING && - !(ifp->if_flags & IFF_PROMISC) && - sc->dc_if_flags & IFF_PROMISC) { - dc_setfilt(sc); - } else if (!(ifp->if_flags & IFF_RUNNING)) { + int need_setfilt = (ifp->if_flags ^ sc->dc_if_flags) & + (IFF_PROMISC | IFF_ALLMULTI); + + if (ifp->if_flags & IFF_RUNNING) { + if (need_setfilt) + dc_setfilt(sc); + } else { sc->dc_txthresh = 0; dc_init(sc); } -- cgit v1.3