diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-09-16 14:22:09 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-24 16:18:00 -0400 |
commit | 723b038def23ce0606754c4f598cbb96bae9a102 (patch) | |
tree | 36193970f99db75c57bf7595bc8d7911c624b8b2 /net/wireless/nl80211.c | |
parent | 60719ffd721f6764b7d07ca188c0d944a4330b69 (diff) |
cfg80211: allow set_interface without type
Which then causes no type change.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r-- | net/wireless/nl80211.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 44771a690d53..a745932d1370 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -422,19 +422,20 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info) | |||
422 | 422 | ||
423 | memset(¶ms, 0, sizeof(params)); | 423 | memset(¶ms, 0, sizeof(params)); |
424 | 424 | ||
425 | if (info->attrs[NL80211_ATTR_IFTYPE]) { | ||
426 | type = nla_get_u32(info->attrs[NL80211_ATTR_IFTYPE]); | ||
427 | if (type > NL80211_IFTYPE_MAX) | ||
428 | return -EINVAL; | ||
429 | } else | ||
430 | return -EINVAL; | ||
431 | |||
432 | err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); | 425 | err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); |
433 | if (err) | 426 | if (err) |
434 | return err; | 427 | return err; |
435 | ifindex = dev->ifindex; | 428 | ifindex = dev->ifindex; |
429 | type = dev->ieee80211_ptr->iftype; | ||
436 | dev_put(dev); | 430 | dev_put(dev); |
437 | 431 | ||
432 | err = -EINVAL; | ||
433 | if (info->attrs[NL80211_ATTR_IFTYPE]) { | ||
434 | type = nla_get_u32(info->attrs[NL80211_ATTR_IFTYPE]); | ||
435 | if (type > NL80211_IFTYPE_MAX) | ||
436 | goto unlock; | ||
437 | } | ||
438 | |||
438 | if (!drv->ops->change_virtual_intf || | 439 | if (!drv->ops->change_virtual_intf || |
439 | !(drv->wiphy.interface_modes & (1 << type))) { | 440 | !(drv->wiphy.interface_modes & (1 << type))) { |
440 | err = -EOPNOTSUPP; | 441 | err = -EOPNOTSUPP; |