Module Name:    src
Committed By:   jdc
Date:           Fri Jun 11 05:00:42 UTC 2021

Modified Files:
        src/sys/dev/ic: an.c

Log Message:
Add a missing htole16() around the length passed to bpf_mtap2().
Allows `tcpdump` to work on BE machines without panicing the kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/dev/ic/an.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/an.c
diff -u src/sys/dev/ic/an.c:1.73 src/sys/dev/ic/an.c:1.74
--- src/sys/dev/ic/an.c:1.73	Wed Jan 29 14:09:58 2020
+++ src/sys/dev/ic/an.c	Fri Jun 11 05:00:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: an.c,v 1.73 2020/01/29 14:09:58 thorpej Exp $	*/
+/*	$NetBSD: an.c,v 1.74 2021/06/11 05:00:41 jdc Exp $	*/
 /*
  * Copyright (c) 1997, 1998, 1999
  *	Bill Paul <wp...@ctr.columbia.edu>.  All rights reserved.
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: an.c,v 1.73 2020/01/29 14:09:58 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: an.c,v 1.74 2021/06/11 05:00:41 jdc Exp $");
 
 
 #include <sys/param.h>
@@ -1509,7 +1509,7 @@ an_rx_intr(struct an_softc *sc)
 		    (le16toh(frmhdr.an_rx_status) & AN_STAT_UNDECRYPTABLE))
 		    tap->ar_flags |= IEEE80211_RADIOTAP_F_BADFCS;
 
-		bpf_mtap2(sc->sc_drvbpf, tap, tap->ar_ihdr.it_len, m,
+		bpf_mtap2(sc->sc_drvbpf, tap, htole16(tap->ar_ihdr.it_len), m,
 		    BPF_D_IN);
 	}
 	wh = mtod(m, struct ieee80211_frame_min *);

Reply via email to