Author: yongari
Date: Sat Mar 19 22:36:59 2011
New Revision: 219787
URL: http://svn.freebsd.org/changeset/base/219787

Log:
  Correct broadcast frame handling. Setting bit6 of MCR0 register
  enables broadcast filtering. Make sure to clear the bit to receive
  broadcast frames. While I'm here rename the bit definition to
  reflect reality.
  
  Reported by:  brad@OpenBSD
  MFC after:    1 week

Modified:
  head/sys/dev/vte/if_vte.c
  head/sys/dev/vte/if_vtereg.h

Modified: head/sys/dev/vte/if_vte.c
==============================================================================
--- head/sys/dev/vte/if_vte.c   Sat Mar 19 21:10:57 2011        (r219786)
+++ head/sys/dev/vte/if_vte.c   Sat Mar 19 22:36:59 2011        (r219787)
@@ -1963,9 +1963,10 @@ vte_rxfilter(struct vte_softc *sc)
        }
 
        mcr = CSR_READ_2(sc, VTE_MCR0);
-       mcr &= ~(MCR0_PROMISC | MCR0_BROADCAST | MCR0_MULTICAST);
+       mcr &= ~(MCR0_PROMISC | MCR0_MULTICAST);
+       mcr |= MCR0_BROADCAST_DIS;
        if ((ifp->if_flags & IFF_BROADCAST) != 0)
-               mcr |= MCR0_BROADCAST;
+               mcr &= ~MCR0_BROADCAST_DIS;
        if ((ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0) {
                if ((ifp->if_flags & IFF_PROMISC) != 0)
                        mcr |= MCR0_PROMISC;

Modified: head/sys/dev/vte/if_vtereg.h
==============================================================================
--- head/sys/dev/vte/if_vtereg.h        Sat Mar 19 21:10:57 2011        
(r219786)
+++ head/sys/dev/vte/if_vtereg.h        Sat Mar 19 22:36:59 2011        
(r219787)
@@ -48,7 +48,7 @@
 #define        MCR0_ACCPT_LONG_PKT             0x0008
 #define        MCR0_ACCPT_DRIBBLE              0x0010
 #define        MCR0_PROMISC                    0x0020
-#define        MCR0_BROADCAST                  0x0040
+#define        MCR0_BROADCAST_DIS              0x0040
 #define        MCR0_RX_EARLY_INTR              0x0080
 #define        MCR0_MULTICAST                  0x0100
 #define        MCR0_FC_ENB                     0x0200
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to