Author: avos
Date: Mon Oct 26 21:03:20 2015
New Revision: 290022
URL: https://svnweb.freebsd.org/changeset/base/290022

Log:
  urtwn(4): do not filter out control frames in the RX path
  
  Approved by:  adrian (mentor)
  Differential Revision:        https://reviews.freebsd.org/D3811

Modified:
  head/sys/dev/usb/wlan/if_urtwn.c

Modified: head/sys/dev/usb/wlan/if_urtwn.c
==============================================================================
--- head/sys/dev/usb/wlan/if_urtwn.c    Mon Oct 26 19:34:12 2015        
(r290021)
+++ head/sys/dev/usb/wlan/if_urtwn.c    Mon Oct 26 21:03:20 2015        
(r290022)
@@ -626,7 +626,8 @@ urtwn_rx_frame(struct urtwn_softc *sc, u
                counter_u64_add(ic->ic_ierrors, 1);
                return (NULL);
        }
-       if (pktlen < sizeof(*wh) || pktlen > MCLBYTES) {
+       if (pktlen < sizeof(struct ieee80211_frame_ack) ||
+           pktlen > MCLBYTES) {
                counter_u64_add(ic->ic_ierrors, 1);
                return (NULL);
        }
@@ -744,7 +745,7 @@ urtwn_bulk_rx_callback(struct usb_xfer *
 {
        struct urtwn_softc *sc = usbd_xfer_softc(xfer);
        struct ieee80211com *ic = &sc->sc_ic;
-       struct ieee80211_frame *wh;
+       struct ieee80211_frame_min *wh;
        struct ieee80211_node *ni;
        struct mbuf *m = NULL, *next;
        struct urtwn_data *data;
@@ -784,9 +785,11 @@ tr_setup:
                while (m != NULL) {
                        next = m->m_next;
                        m->m_next = NULL;
-                       wh = mtod(m, struct ieee80211_frame *);
-                       ni = ieee80211_find_rxnode(ic,
-                           (struct ieee80211_frame_min *)wh);
+                       wh = mtod(m, struct ieee80211_frame_min *);
+                       if (m->m_len >= sizeof(*wh))
+                               ni = ieee80211_find_rxnode(ic, wh);
+                       else
+                               ni = NULL;
                        nf = URTWN_NOISE_FLOOR;
                        if (ni != NULL) {
                                (void)ieee80211_input(ni, m, rssi - nf, nf);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to