Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Jouni Malinen <jouni@qca.qualcomm.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] cfg80211: Allow TDLS peer AID to be configured for VHT
Date: Fri, 24 May 2013 22:39:03 +0200	[thread overview]
Message-ID: <1369427943.13623.8.camel@johannes> (raw)
In-Reply-To: <20130516171108.GA27497@jouni.qca.qualcomm.com>

On Thu, 2013-05-16 at 20:11 +0300, Jouni Malinen wrote:

> -	if (!info->attrs[NL80211_ATTR_STA_AID])
> +	if (!info->attrs[NL80211_ATTR_STA_AID] &&
> +	    !info->attrs[NL80211_ATTR_PEER_AID])
>  		return -EINVAL;

Technically here I think you could check that this attribute isn't used
with non-TDLS stations, since in new_station you know what it's going to
be, right?

> @@ -3985,7 +3989,10 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
>  	params.listen_interval =
>  		nla_get_u16(info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL]);
>  
> -	params.aid = nla_get_u16(info->attrs[NL80211_ATTR_STA_AID]);
> +	if (info->attrs[NL80211_ATTR_STA_AID])
> +		params.aid = nla_get_u16(info->attrs[NL80211_ATTR_STA_AID]);
> +	else
> +		params.aid = nla_get_u16(info->attrs[NL80211_ATTR_PEER_AID]);

This is a bit strange? Wouldn't you want to prefer the new attribute, so
you can put some possibly invalid value into the old attribute for old
kernels? Otherwise what's the reason for even reading the new attribute
in this code at all, if new userspace code must set the old attribute
for old kernels anyway?

johannes


  reply	other threads:[~2013-05-24 20:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-16 17:11 [PATCH] cfg80211: Allow TDLS peer AID to be configured for VHT Jouni Malinen
2013-05-24 20:39 ` Johannes Berg [this message]
2013-05-27 15:14   ` Jouni Malinen
2013-05-27 15:24   ` [PATCH v2] " Jouni Malinen
2013-06-11 12:37     ` 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=1369427943.13623.8.camel@johannes \
    --to=johannes@sipsolutions.net \
    --cc=jouni@qca.qualcomm.com \
    --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