Stefan Sperling
2016-02-03 16:03:46 UTC
This allows tcpdump to see all control frames with iwn(4).
Index: if_iwn.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_iwn.c,v
retrieving revision 1.158
diff -u -p -r1.158 if_iwn.c
--- if_iwn.c 25 Jan 2016 11:27:11 -0000 1.158
+++ if_iwn.c 3 Feb 2016 16:01:58 -0000
@@ -2007,8 +2007,11 @@ iwn_rx_done(struct iwn_softc *sc, struct
ifp->if_ierrors++;
return;
}
- /* Discard frames that are too short. */
- if (len < sizeof (*wh)) {
+ /*
+ * Discard frames that are too short, unless in monitor mode where we
+ * receive control frames which are shorter than regular data frames.
+ */
+ if (len < sizeof (*wh) && ic->ic_opmode != IEEE80211_M_MONITOR) {
DPRINTF(("frame too short: %d\n", len));
ic->ic_stats.is_rx_tooshort++;
ifp->if_ierrors++;
Index: if_iwn.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_iwn.c,v
retrieving revision 1.158
diff -u -p -r1.158 if_iwn.c
--- if_iwn.c 25 Jan 2016 11:27:11 -0000 1.158
+++ if_iwn.c 3 Feb 2016 16:01:58 -0000
@@ -2007,8 +2007,11 @@ iwn_rx_done(struct iwn_softc *sc, struct
ifp->if_ierrors++;
return;
}
- /* Discard frames that are too short. */
- if (len < sizeof (*wh)) {
+ /*
+ * Discard frames that are too short, unless in monitor mode where we
+ * receive control frames which are shorter than regular data frames.
+ */
+ if (len < sizeof (*wh) && ic->ic_opmode != IEEE80211_M_MONITOR) {
DPRINTF(("frame too short: %d\n", len));
ic->ic_stats.is_rx_tooshort++;
ifp->if_ierrors++;