Skip to content

Commit

Permalink
mac80211: allow mode change if IBSS is not allowed
Browse files Browse the repository at this point in the history
Changing mode on an interface is not allowed if IBSS is disabled for the
current channel.  That restriction should only apply when switching to
the ad-hoc mode, as it was prior to "cfg80211: handle SIOCGIWMODE/SIOCSIWMODE".

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Pavel Roskin authored and John W. Linville committed Jan 12, 2009
1 parent 4fb7404 commit dcebf45
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/mac80211/iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,8 @@ int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata,
return 0;

/* Setting ad-hoc mode on non-IBSS channel is not supported. */
if (sdata->local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS)
if (sdata->local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS &&
type == NL80211_IFTYPE_ADHOC)
return -EOPNOTSUPP;

/*
Expand Down

0 comments on commit dcebf45

Please sign in to comment.