Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Fix previous; We also need to turn off IFF_ALLMU...



details:   https://anonhg.NetBSD.org/src/rev/e89a2f97bece
branches:  trunk
changeset: 446850:e89a2f97bece
user:      rin <rin%NetBSD.org@localhost>
date:      Sat Dec 22 16:58:51 2018 +0000

description:
Fix previous; We also need to turn off IFF_ALLMULTI bit when
it is disabled.

diffstat:

 sys/dev/usb/if_mue.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (42 lines):

diff -r 1df8aedf5e13 -r e89a2f97bece sys/dev/usb/if_mue.c
--- a/sys/dev/usb/if_mue.c      Sat Dec 22 14:39:46 2018 +0000
+++ b/sys/dev/usb/if_mue.c      Sat Dec 22 16:58:51 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_mue.c,v 1.24 2018/12/20 02:52:59 rin Exp $  */
+/*     $NetBSD: if_mue.c,v 1.25 2018/12/22 16:58:51 rin Exp $  */
 /*     $OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $  */
 
 /*
@@ -20,7 +20,7 @@
 /* Driver for Microchip LAN7500/LAN7800 chipsets. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.24 2018/12/20 02:52:59 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.25 2018/12/22 16:58:51 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1330,11 +1330,11 @@
        /* Always accept broadcast frames. */
        rxfilt |= MUE_RFE_CTL_BROADCAST;
 
-       if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) {
-allmulti:      ifp->if_flags |= IFF_ALLMULTI;
-               rxfilt |= MUE_RFE_CTL_MULTICAST;
+       if (ifp->if_flags & IFF_PROMISC) {
+               rxfilt |= MUE_RFE_CTL_UNICAST;
+allmulti:      rxfilt |= MUE_RFE_CTL_MULTICAST;
+               ifp->if_flags |= IFF_ALLMULTI;
                if (ifp->if_flags & IFF_PROMISC) {
-                       rxfilt |= MUE_RFE_CTL_UNICAST;
                        DPRINTF(sc, "promisc\n");
                } else {
                        DPRINTF(sc, "allmulti\n");
@@ -1369,6 +1369,7 @@
                        ETHER_NEXT_MULTI(step, enm);
                }
                rxfilt |= MUE_RFE_CTL_PERFECT;
+               ifp->if_flags &= ~IFF_ALLMULTI;
                if (rxfilt & MUE_RFE_CTL_MULTICAST_HASH) {
                        DPRINTF(sc, "perfect filter and hash tables\n");
                } else {



Home | Main Index | Thread Index | Old Index