Source-Changes-HG archive

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

[src-draft/trunk]: src/sys/net80211 Fix bpf handling part 1 (from James Brown...



details:   https://anonhg.NetBSD.org/src-all/rev/7af76c5c8ab2
branches:  trunk
changeset: 364335:7af76c5c8ab2
user:      Martin Husemann <martin%NetBSD.org@localhost>
date:      Sat Mar 05 19:11:37 2022 +0100

description:
Fix bpf handling part 1 (from James Browning).

We have been using the DLT_IEEE802_11 bpf type by default for wlan
interfaces, but that is not what applications expect. Move back
to DLT_EN10MB (aka ethernet).

diffstat:

 sys/dev/usb/usbwifi.c           |  2 +-
 sys/net80211/ieee80211_netbsd.c |  4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r 4f82bdd023d1 -r 7af76c5c8ab2 sys/dev/usb/usbwifi.c
--- a/sys/dev/usb/usbwifi.c     Sun Feb 27 15:14:24 2022 +0100
+++ b/sys/dev/usb/usbwifi.c     Sat Mar 05 19:11:37 2022 +0100
@@ -868,7 +868,7 @@
                 * to him.
                 */
                if (vap != NULL)
-                       bpf_mtap(vap->iv_ifp, m, BPF_D_OUT);
+                       ieee80211_radiotap_tx(vap, m);
 
                idx = (idx + 1) % uw->uw_tx_list_cnt;
                s_chain->uwscd_tx_cnt++;
diff -r 4f82bdd023d1 -r 7af76c5c8ab2 sys/net80211/ieee80211_netbsd.c
--- a/sys/net80211/ieee80211_netbsd.c   Sun Feb 27 15:14:24 2022 +0100
+++ b/sys/net80211/ieee80211_netbsd.c   Sat Mar 05 19:11:37 2022 +0100
@@ -1572,7 +1572,7 @@
 {
        ifp->if_type = IFT_ETHER;
        ifp->if_hdrlen = ETHER_HDR_LEN;
-       ifp->if_dlt = DLT_IEEE802_11;
+       ifp->if_dlt = DLT_EN10MB;
        ifp->if_mtu = ETHERMTU;
        ifp->if_output = ether_output;
        ifp->_if_input = ether_input;
@@ -1583,5 +1583,5 @@
                if_set_sadl(ifp, lla, ETHER_ADDR_LEN, !ETHER_IS_LOCAL(lla));
 
        ifp->if_broadcastaddr = etherbroadcastaddr;
-       bpf_attach(ifp, DLT_IEEE802_11, sizeof(struct ieee80211_frame));
+       bpf_attach(ifp, DLT_EN10MB, ETHER_HDR_LEN);
 }



Home | Main Index | Thread Index | Old Index