Search Linux Wireless

Re: [PATCH 2/3] cfg80211: implement multi-vif interface combination validation

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

 



On 21 January 2014 16:41, Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote:
> On Mon, 2014-01-20 at 15:09 +0100, Michal Kazior wrote:
>
>> +             /* sanity check - make sure all wdevs in params[] are unique */
>> +             for (j = 0; j < num_params; j++)
>> +                     if (WARN_ON(i != j && params[i].wdev == params[j].wdev))
>> +                             return -EINVAL;
>> +
>> +             if (params[i].wdev && params[i].wdev->wiphy != &rdev->wiphy)
>> +                     return -EINVAL;
>
> How could you ever have a param without a wdev? That seems like a bug as
> well?

cfg80211_can_add_interface() calls with wdev == NULL.


>> +             used_iftypes |= BIT(params[i].iftype);
>> +             num[params[i].iftype]++;
>> +
>> +             err = cfg80211_is_radar_required(params[i].iftype,
>> +                                              params[i].chan,
>> +                                              params[i].chanmode,
>> +                                              params[i].radar_detect_width);
>> +             if (err < 0)
>> +                     return err;
>> +             else if (err && !params[i].radar_detect_width)
>> +                     return -EINVAL;
>
> That's a bit confusing - why do you pass the radar_detect_width in, and
> then check it again? Couldn't you just do all the checks in the
> function, perhaps renamed a bit?

I can move this into the helper function. Any suggestions for the
rename? cfg80211_validate_radar_params() and it would return a 0 or an
errno?


Michał
--
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