Linux wireless drivers development
 help / color / mirror / Atom feed
From: stefano.brivio@polimi.it
To: Michael Wu <flamingice@sourmilk.net>
Cc: John Linville <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org,
	Johannes Berg <johannes@sipsolutions.net>,
	Mattias Nissler <mattias.nissler@gmx.de>
Subject: Re: [PATCH] mac80211: Fix rate reporting regression
Date: Wed, 26 Dec 2007 01:20:07 +0100	[thread overview]
Message-ID: <20071226012007.otwhbzzi80ck8kko@webmail.polimi.it> (raw)
In-Reply-To: <20071226000958.21143.10527.stgit@tetra.sourmilk.net>

Quoting Michael Wu <flamingice@sourmilk.net>:

> Mattias Nissler's "clean up rate selection" patch incorrectly changes
> the behavior of txrate setting in sta_info. This patch backs out parts
> of the rate selection consolidation in order to fix this issue for now.

Looks good, except that...

> --- a/net/mac80211/rc80211_pid_algo.c
> +++ b/net/mac80211/rc80211_pid_algo.c
> @@ -307,22 +307,34 @@ static void rate_control_pid_get_rate(void   
> *priv, struct net_device *dev,
>  {
>  	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
>  	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
> +	struct ieee80211_sub_if_data *sdata;
>  	struct sta_info *sta;
>  	int rateidx;
> +	u16 fc;
>
>  	sta = sta_info_get(local, hdr->addr1);
>
> -	if (!sta) {
> -		sel->rate = rate_lowest(local, mode, NULL);
> -		sta_info_put(sta);
> +	/* Send management frames and broadcast/multicast data using lowest
> +	 * rate. */
> +	fc = le16_to_cpu(hdr->frame_control);
> +	if ((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA ||
> +	    is_multicast_ether_addr(hdr->addr1) || !sta) {
> +		sel->rate = rate_lowest(local, mode, sta);
>  		return;
>  	}
>
> +	/* If a forced rate is in effect, select it. */
> +	sdata = IEEE80211_DEV_TO_SUB_IF(dev);
> +	if (sdata->bss && sdata->bss->force_unicast_rateidx > -1)
> +		sta->txrate = sdata->bss->force_unicast_rateidx;

...you could be dereferencing a NULL pointer :)


--
Ciao
Stefano




  reply	other threads:[~2007-12-26  0:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-26  0:09 [PATCH] mac80211: Fix rate reporting regression Michael Wu
2007-12-26  0:20 ` stefano.brivio [this message]
2007-12-26  0:26   ` stefano.brivio

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=20071226012007.otwhbzzi80ck8kko@webmail.polimi.it \
    --to=stefano.brivio@polimi.it \
    --cc=flamingice@sourmilk.net \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mattias.nissler@gmx.de \
    /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