Search Linux Wireless

Re: paged RX skbs and BlockAck Request packets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On May 28, 2010, at 1:34 PM, Johannes Berg wrote:
> One thing I ask myself though is do we ever check that the frame is long
> enough? In the patch below I will by checking the skb_copy_bits() return
> value, but without that we don't, as far as I can tell?

Good point.

> --- wireless-testing.orig/net/mac80211/rx.c	2010-05-28 22:25:07.000000000 +0200
> +++ wireless-testing/net/mac80211/rx.c	2010-05-28 22:33:30.000000000 +0200
> @@ -1819,17 +1819,26 @@ ieee80211_rx_h_ctrl(struct ieee80211_rx_
> 		return RX_CONTINUE;
> 
> 	if (ieee80211_is_back_req(bar->frame_control)) {
> +		struct {
> +			__le16 control, start_seq_num;
> +		} __packed bar_data;
> +
> +		if (skb_copy_bits(skb, offsetof(struct ieee80211_bar, control),
> +				  &bar_data, sizeof(bar_data)))
> +			return RX_DROP_MONITOR;
> +
> 		if (!rx->sta)
> 			return RX_DROP_MONITOR;

Maybe invert the order of these two exit conditions? Figure most CPUs will speculate anyway, but the second check seems a more efficient short-circuit.

Dan--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux