From 1902276e19d3fdc46d9cdbc9832f2d670d1de540 Mon Sep 17 00:00:00 2001 From: Andriy Voskoboinyk Date: Fri, 24 Jun 2016 23:43:19 +0000 Subject: [PATCH] urtwn: use m_get2() in Rx path. Replace m_getcl() with m_get2(); this fixes 'frame too long' messages for frames, which are longer than MCLBYTES (can be easily triggered when A-MSDU is used). Tested with RTL8188CUS (AP) and RTL8188EU (STA). Approved by: re (marius) --- sys/dev/urtwn/if_urtwn.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/sys/dev/urtwn/if_urtwn.c b/sys/dev/urtwn/if_urtwn.c index eacc8bb311d..f5d38189a84 100644 --- a/sys/dev/urtwn/if_urtwn.c +++ b/sys/dev/urtwn/if_urtwn.c @@ -895,14 +895,7 @@ urtwn_rx_copy_to_mbuf(struct urtwn_softc *sc, struct r92c_rx_stat *stat, goto fail; } - if (__predict_false(totlen > MCLBYTES)) { - /* convert to m_getjcl if this happens */ - device_printf(sc->sc_dev, "%s: frame too long: %d (%d)\n", - __func__, pktlen, totlen); - goto fail; - } - - m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + m = m_get2(totlen, M_NOWAIT, MT_DATA, M_PKTHDR); if (__predict_false(m == NULL)) { device_printf(sc->sc_dev, "%s: could not allocate RX mbuf\n", __func__);