Return-path: Received: from he.sipsolutions.net ([78.46.109.217]:60754 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751639Ab0JAQGw (ORCPT ); Fri, 1 Oct 2010 12:06:52 -0400 Subject: Re: [PATCH 2/3] cfg80211: patches to allow setting the WDS peer From: Johannes Berg To: Bill Jordan Cc: "John W. Linville" , linux-wireless@vger.kernel.org, "Luis R. Rodriguez" In-Reply-To: <1285949159.3739.37.camel@jlt3.sipsolutions.net> References: <1285946441-20152-1-git-send-email-bjordan@rajant.com> <1285946441-20152-3-git-send-email-bjordan@rajant.com> <1285949159.3739.37.camel@jlt3.sipsolutions.net> Content-Type: text/plain; charset="UTF-8" Date: Fri, 01 Oct 2010 18:06:52 +0200 Message-ID: <1285949212.3739.38.camel@jlt3.sipsolutions.net> Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Fri, 2010-10-01 at 18:05 +0200, Johannes Berg wrote: > On Fri, 2010-10-01 at 11:20 -0400, Bill Jordan wrote: > > > +static int nl80211_set_wds_peer(struct sk_buff *skb, struct genl_info *info) > > +{ > > + struct cfg80211_registered_device *rdev; > > + struct wireless_dev *wdev; > > + struct net_device *dev; > > + u8 *bssid; > > + int err; > > + > > + if (!info->attrs[NL80211_ATTR_MAC]) > > + return -EINVAL; > > + > > + rtnl_lock(); > > + > > + err = get_rdev_dev_by_info_ifindex(info, &rdev, &dev); > > + if (err) > > + goto unlock_rtnl; > > + > > + wdev = dev->ieee80211_ptr; > > I think this (or maybe the mac80211 bit, but I think here makes more > sense) needs to check !netif_running(), otherwise you can change the > peer without it taking effect, or something like that? Sorry, should've > noted that earlier. cfg80211_wds_wext_siwap does this. johannes