aboutsummaryrefslogtreecommitdiff
path: root/net/mac80211/wext.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-11-25 14:27:58 -0800
committerDavid S. Miller <davem@davemloft.net>2008-11-25 14:27:58 -0800
commitd7713ccc7bec64fbe0e4e39f93b17dfec711db7f (patch)
tree586afddc7e21ecaa82fc9af369778e53de93fb4e /net/mac80211/wext.c
parent11c6dd2c723a9ff9bdd4ee11b2798a08abc94e98 (diff)
parent020cf6ba7a91ccc5db359f91e9abba175fd3a0aa (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
Diffstat (limited to 'net/mac80211/wext.c')
-rw-r--r--net/mac80211/wext.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c
index 742f811ca41..ab4ddba874b 100644
--- a/net/mac80211/wext.c
+++ b/net/mac80211/wext.c
@@ -271,6 +271,7 @@ static int ieee80211_ioctl_siwmode(struct net_device *dev,
__u32 *mode, char *extra)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ struct ieee80211_local *local = sdata->local;
int type;
if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
@@ -281,6 +282,13 @@ static int ieee80211_ioctl_siwmode(struct net_device *dev,
type = NL80211_IFTYPE_STATION;
break;
case IW_MODE_ADHOC:
+ /* Setting ad-hoc mode on non ibss channel is not
+ * supported.
+ */
+ if (local->oper_channel &&
+ (local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS))
+ return -EOPNOTSUPP;
+
type = NL80211_IFTYPE_ADHOC;
break;
case IW_MODE_REPEAT: