Search Linux Wireless

Re: [PATCH v2] nl80211: Allow GET_INTERFACE dumps to be filtered

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

 



>  static int nl80211_dump_interface(struct sk_buff *skb, struct
> netlink_callback *cb)
>  {
> -	int wp_idx = 0;
> -	int if_idx = 0;
> -	int wp_start = cb->args[0];
> -	int if_start = cb->args[1];
>  	struct cfg80211_registered_device *rdev;
>  	struct wireless_dev *wdev;
> +	unsigned int wp_idx = 0;
> +	unsigned int if_idx;
> +	static struct dump_interface_context static_ctx;
> +	struct dump_interface_context *ctx = cb->args[0];
> +
> +	if (!ctx) {
> +		int ret;
> +
> +		static_ctx.wp_start = 0;
> +		static_ctx.if_start = 0;
> +		static_ctx.filter_wiphy = -1;
> +
> +		ret = nl80211_dump_interface_parse(skb, cb,
> +						   &static_ctx.filte
> r_wiphy);
> +		if (ret)
> +			return ret;
> +
> +		ctx = &static_ctx;
> +		cb->args[0] = ctx;

You can't do this, multiple applications are allowed to dump at the
same time. I think I'll take your previous patch and adjust it a bit.

johannes



[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