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>
This commit is contained in:
parent
60719ffd72
commit
723b038def
1 changed files with 8 additions and 7 deletions
|
@ -422,19 +422,20 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
|
||||||
|
|
||||||
memset(¶ms, 0, sizeof(params));
|
memset(¶ms, 0, sizeof(params));
|
||||||
|
|
||||||
if (info->attrs[NL80211_ATTR_IFTYPE]) {
|
|
||||||
type = nla_get_u32(info->attrs[NL80211_ATTR_IFTYPE]);
|
|
||||||
if (type > NL80211_IFTYPE_MAX)
|
|
||||||
return -EINVAL;
|
|
||||||
} else
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev);
|
err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
ifindex = dev->ifindex;
|
ifindex = dev->ifindex;
|
||||||
|
type = dev->ieee80211_ptr->iftype;
|
||||||
dev_put(dev);
|
dev_put(dev);
|
||||||
|
|
||||||
|
err = -EINVAL;
|
||||||
|
if (info->attrs[NL80211_ATTR_IFTYPE]) {
|
||||||
|
type = nla_get_u32(info->attrs[NL80211_ATTR_IFTYPE]);
|
||||||
|
if (type > NL80211_IFTYPE_MAX)
|
||||||
|
goto unlock;
|
||||||
|
}
|
||||||
|
|
||||||
if (!drv->ops->change_virtual_intf ||
|
if (!drv->ops->change_virtual_intf ||
|
||||||
!(drv->wiphy.interface_modes & (1 << type))) {
|
!(drv->wiphy.interface_modes & (1 << type))) {
|
||||||
err = -EOPNOTSUPP;
|
err = -EOPNOTSUPP;
|
||||||
|
|
Loading…
Add table
Reference in a new issue