Search Linux Wireless

Re: [RFC] mac80211_hwsim: Implements a check for ATTR_FREQ inside hwsim_cloned_frame_received_nl

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

 



On Fri, 2015-10-30 at 17:00 -0400, arwelle@xxxxxxxx wrote:
> From: Adam Welle <arwelle@xxxxxxxx>
> 
> If a frame is received from netlink with this value set it is checked 
> against the current radio's frequency and discarded if different.

Please line-break the commit log to <=72 characters/line.

> +	/* Check ATTR_FREQ if it exists, and throw away off-channel 
> packets */
> +	if (info->attrs[HWSIM_ATTR_FREQ])
> +		rx_status.freq = nla_get_u32(info
> ->attrs[HWSIM_ATTR_FREQ]);
> +	else
> +		rx_status.freq = data2->channel->center_freq;
> +
> +	/* Drop packet if not on the same frequency as this radio */
> +	if (rx_status.freq != data2->channel->center_freq)
> +		goto out;
> 
I think it'd make sense to have that check only in the case that the
attribute existed. I'm not too concerned about performance here, but
more generally it looks odd if you're checking when you know it can't
be different.

johannes
--
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 Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux