Search Linux Wireless

Re: [PATCH] cfg80211: fix cmp_hidden_bss

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

 



On Wed, Nov 28, 2012 at 11:44 PM, Johannes Berg
<johannes@xxxxxxxxxxxxxxxx> wrote:
> From: Johannes Berg <johannes.berg@xxxxxxxxx>
>
> The cmp_bss() comparator function uses memcmp() to
> compare the SSID. This means that cmp_hidden_bss()
> needs to similarly return a number bigger than zero
> (use 1) instead of -1 when ie1 is bigger than ie2,
> which is the case if an ie2 byte is non-zero.
>
> Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
> ---
>  net/wireless/scan.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/wireless/scan.c b/net/wireless/scan.c
> index 9233910..57855bc 100644
> --- a/net/wireless/scan.c
> +++ b/net/wireless/scan.c
> @@ -472,7 +472,7 @@ static int cmp_hidden_bss(struct cfg80211_bss *a, struct cfg80211_bss *b)
>         /* zeroed SSID ie is another indication of a hidden bss */
>         for (i = 0; i < ie2[1]; i++)
>                 if (ie2[i + 2])
> -                       return -1;
> +                       return 1;
>
>         return 0;
>  }

maybe i'm misreading it, but there is still no comparison here at all,
so it seems wrong as well :)
(practically, i guess it doesn't really matter, because if there is
some non-null char, this is not a hidden ssid anyway)

Eliad.
--
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