Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Don't check if the frame is for us in the driver



details:   https://anonhg.NetBSD.org/src/rev/3025cc18b062
branches:  trunk
changeset: 349321:3025cc18b062
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Tue Dec 06 08:21:47 2016 +0000

description:
Don't check if the frame is for us in the driver

It's done normally by ether_input now. And also if drop packets here,
bridge(4) doesn't work with the driver.

diffstat:

 sys/dev/ic/lemac.c |  20 +++++---------------
 1 files changed, 5 insertions(+), 15 deletions(-)

diffs (43 lines):

diff -r 532195718bc2 -r 3025cc18b062 sys/dev/ic/lemac.c
--- a/sys/dev/ic/lemac.c        Tue Dec 06 08:03:09 2016 +0000
+++ b/sys/dev/ic/lemac.c        Tue Dec 06 08:21:47 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lemac.c,v 1.45 2016/06/10 13:27:13 ozaki-r Exp $ */
+/* $NetBSD: lemac.c,v 1.46 2016/12/06 08:21:47 ozaki-r Exp $ */
 
 /*-
  * Copyright (c) 1994, 1995, 1997 Matt Thomas <matt%3am-software.com@localhost>
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lemac.c,v 1.45 2016/06/10 13:27:13 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lemac.c,v 1.46 2016/12/06 08:21:47 ozaki-r Exp $");
 
 #include "opt_inet.h"
 
@@ -302,21 +302,11 @@
        if (length & 1)
            m->m_data[length - 1] = LEMAC_GET8(sc, offset + length - 1);
     }
-    if (sc->sc_if.if_bpf != NULL) {
-       m->m_pkthdr.len = m->m_len = length;
-       bpf_mtap(&sc->sc_if, m);
-    }
-    /*
-     * If this is single cast but not to us
-     * drop it!
-     */
-    if ((eh.ether_dhost[0] & 1) == 0
-          && !LEMAC_ADDREQUAL(eh.ether_dhost, sc->sc_enaddr)) {
-       m_freem(m);
-       return;
-    }
+
     m->m_pkthdr.len = m->m_len = length;
     m_set_rcvif(m, &sc->sc_if);
+    bpf_mtap(&sc->sc_if, m);
+
     if_percpuq_enqueue((&sc->sc_if)->if_percpuq, m);
 }
 



Home | Main Index | Thread Index | Old Index