From: Manikanta Pubbisetty <mpubbise@codeaurora.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH v3] {nl,mac}80211: allow 4addr AP operation on crypto controlled devices
Date: Fri, 31 May 2019 10:03:52 +0530 [thread overview]
Message-ID: <c8484254-f4f7-9955-e3f8-8a423cc6c325@codeaurora.org> (raw)
In-Reply-To: <fd3addc01fc3f5362dba5771ee82659cf01c195b.camel@sipsolutions.net>
On 5/14/2019 2:08 PM, Johannes Berg wrote:
> On Wed, 2019-05-08 at 14:55 +0530, Manikanta Pubbisetty wrote:
>> +++ b/net/mac80211/util.c
>> @@ -3795,7 +3795,9 @@ int ieee80211_check_combinations(struct ieee80211_sub_if_data *sdata,
>> }
>>
>> /* Always allow software iftypes */
>> - if (local->hw.wiphy->software_iftypes & BIT(iftype)) {
>> + if (local->hw.wiphy->software_iftypes & BIT(iftype) ||
>> + (iftype == NL80211_IFTYPE_AP_VLAN &&
>> + local->hw.wiphy->flags & WIPHY_FLAG_4ADDR_AP)) {
>> if (radar_detect)
>> return -EINVAL;
> Shouldn't this check if 4addr is actually enabled too, like here:
Sure Johannes, I'll look into it.
>> case NETDEV_PRE_UP:
>> - if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype)))
>> + if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype)) &&
>> + !(wdev->iftype == NL80211_IFTYPE_AP_VLAN &&
>> + rdev->wiphy.flags & WIPHY_FLAG_4ADDR_AP &&
>> + wdev->use_4addr))
>> return notifier_from_errno(-EOPNOTSUPP);
> ?
> Or is there some reason it doesn't matter?
>
>> @@ -3439,6 +3438,11 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
>> return err;
>> }
>>
>> + if (!(rdev->wiphy.interface_modes & (1 << type)) &&
>> + !(type == NL80211_IFTYPE_AP_VLAN && params.use_4addr &&
>> + rdev->wiphy.flags & WIPHY_FLAG_4ADDR_AP))
>> + return -EOPNOTSUPP;
>> +
> I also wonder if we shouldn't go "all in" and actually make the check
> something like
>
> check_interface_allowed(iftype, 4addr):
> if (iftype == AP_VLAN && 4addr)
> return wiphy.flags & WIPHY_FLAG_4ADDR_AP;
>
> else return wiphy.interface_modes & BIT(iftype);
>
> i.e. make it "you must have WIPHY_FLAG_4ADDR_AP to use 4-addr AP_VLAN
> interfaces", rather than "also allow it in this case".
>
> That would seem like the clearer semantics to me?
Yeah, it can be better; I'll check if this is feasible.
Thanks,
Manikanta
next prev parent reply other threads:[~2019-05-31 4:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-08 9:25 [PATCH v3] {nl,mac}80211: allow 4addr AP operation on crypto controlled devices Manikanta Pubbisetty
2019-05-14 8:38 ` Johannes Berg
2019-05-31 4:33 ` Manikanta Pubbisetty [this message]
2019-06-06 18:41 ` Tom Psyborg
2019-06-12 19:30 ` Johannes Berg
2019-06-14 17:45 ` Tom Psyborg
2019-06-14 18:43 ` Johannes Berg
2019-06-14 20:27 ` Tom Psyborg
2019-06-14 20:37 ` Johannes Berg
2019-06-17 5:07 ` Stefan Lippers-Hollmann
2019-06-17 7:06 ` Johannes Berg
2019-06-17 7:36 ` Stefan Lippers-Hollmann
2019-06-17 11:32 ` Tom Psyborg
2019-06-28 14:02 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c8484254-f4f7-9955-e3f8-8a423cc6c325@codeaurora.org \
--to=mpubbise@codeaurora.org \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).