Search Linux Wireless

Re: [PATCH v2] iw: add packet offset information for wowlan pattern

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

 



On Tue, 2013-02-12 at 12:16 -0800, Bing Zhao wrote:
> From: Amitkumar Karwar <akarwar@xxxxxxxxxxx>
> 
> Now user can provide packet offset along with the pattern in
> "iw wowlan" command. Default offset will be 0 when it is not
> provided.
> 
> A trailing ':' should be used for single byte pattern to
> distinguish it from an offset.
> Ex. "iw phy phy# wowlan patterns 18 43:" means wakeup on
> offset 18 pattern 0x43.

>  			if (tb_wowlan[NL80211_WOWLAN_TRIG_PKT_PATTERN]) {
>  				pat = nla_data(tb_wowlan[NL80211_WOWLAN_TRIG_PKT_PATTERN]);
> -				printf("\t\t * wake up on pattern match, up to %u patterns of %u-%u bytes\n",
> -					pat->max_patterns, pat->min_pattern_len, pat->max_pattern_len);
> +				printf("\t\t * wake up on pattern match, up to %u patterns of %u-%u bytes,\n"
> +					"\t\t   maximum packet offset %u bytes\n",
> +					pat->max_patterns, pat->min_pattern_len, pat->max_pattern_len, pat->max_pkt_offset);

This will in the best case print something random on old kernels, and in
the absolute worst case crash, so please fix that by detecting the size
of the struct.

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