]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - net/wireless/nl80211.c
{nl,mac}80211: allow 4addr AP operation on crypto controlled devices
[mirror_ubuntu-bionic-kernel.git] / net / wireless / nl80211.c
index 8d89cc9cd24e76055dfa836dbdd1b8901afaf6de..0033a7e100573d0c7377ed209f7ec87de2ced0f1 100644 (file)
@@ -2951,8 +2951,7 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
                        return -EINVAL;
        }
 
-       if (!rdev->ops->add_virtual_intf ||
-           !(rdev->wiphy.interface_modes & (1 << type)))
+       if (!rdev->ops->add_virtual_intf)
                return -EOPNOTSUPP;
 
        if ((type == NL80211_IFTYPE_P2P_DEVICE || type == NL80211_IFTYPE_NAN ||
@@ -2971,6 +2970,11 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
                        return err;
        }
 
+       if (!(rdev->wiphy.interface_modes & (1 << type)) &&
+           !(type == NL80211_IFTYPE_AP_VLAN && params.use_4addr &&
+             rdev->wiphy.flags & WIPHY_FLAG_4ADDR_AP))
+               return -EOPNOTSUPP;
+
        err = nl80211_parse_mon_options(rdev, type, info, &params);
        if (err < 0)
                return err;