Search Linux Wireless

Re: [PATCH v2 4/6] mac80211: Save probe response data for BSS

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

 



On Sun, 2011-01-23 at 23:02 +0200, Arik Nemtsov wrote:

> +static int ieee80211_set_probe_resp(struct wiphy *wiphy,
> +				    struct net_device *dev, u8 *resp,
> +				    size_t resp_len)
> +{
> +	struct ieee80211_sub_if_data *sdata;
> +	struct sk_buff *new, *old;
> +
> +	sdata = IEEE80211_DEV_TO_SUB_IF(dev);
> +	old = sdata->u.ap.probe_resp;
> +
> +	if (!resp || !resp_len)
> +		return -EINVAL;
> +
> +	new = dev_alloc_skb(resp_len);
> +	if (!new) {
> +		printk(KERN_DEBUG "%s: failed to allocate buffer for probe "
> +		       "response template\n", sdata->name);
> +		return -ENOMEM;

I'd remove that message -- userspace already knows, and it's the only
thing that really needs to?

> +	}
> +
> +	memcpy(skb_put(new, resp_len), resp, resp_len);
> +
> +	rcu_assign_pointer(sdata->u.ap.probe_resp, new);
> +	synchronize_rcu();
> +
> +	if (old)
> +		dev_kfree_skb(old);

Just a note -- I don't really expect you to implement this -- but I
think since the skb's CB is not used otherwise, we could easily use
call_rcu() to free it.

johannes

--
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 Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux