]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
When punting frames to the RX tap, free the mbufs since we've tampered with
authoradrian <adrian@FreeBSD.org>
Fri, 28 Oct 2011 15:44:09 +0000 (15:44 +0000)
committeradrian <adrian@FreeBSD.org>
Fri, 28 Oct 2011 15:44:09 +0000 (15:44 +0000)
commitdce52fa1190fc0da96a2049b9d5be90bf30fb8d5
tree69f14ea0b84d2035d0c7ffae6034a8a76e6cc715
parentf9aa1bdb2352c88cffdc0726aeb78234ef991338
When punting frames to the RX tap, free the mbufs since we've tampered with
their length.

Without this, an error frame mbuf would:

* have its size adjusted;
* thrown at the radiotap code;
* then since it's never consumed, the rxbuf/mbuf is then re-added to the
  RX descriptor list with the small size;
* .. and the hardware ends up (sometimes) only DMA'ing part of a frame into
  the small buffer, chaining RX frames together (setting the more flag).

I discovered this particular issue when doing some promiscuous radiotap
testing; I found that I'd occasionally get rs_more set in RX descriptors
w/ the first frame length being very small (sub-100 bytes.) The driver
handles 2-descriptor RX frames (but not more), so this still worked; it
was just odd.

This is suboptimal and may benefit from being replaced with caching
the m_pkthdr_len and m_len fields, then restoring them after completion.
sys/dev/ath/if_ath.c