History

nl80211: add no pre-auth attribute and ext. feature flag for ctrl. port

If the nl80211 control port is used before this patch, pre-auth frames (0x88c7) are send to userspace uncoditionally. While this enables userspace to only use nl80211 on the station side, it is not always useful for APs. Furthermore, pre-auth frames are ordinary data frames and not related to the control port. Therefore it should for example be possible for pre-auth frames to be bridged onto a wired network on AP side without touching userspace. For backwards compatibility to code already using pre-auth over nl80211, this patch adds a feature flag to disable this behavior, while it remains enabled by default. An additional ext. feature flag is added to detect this from userspace. Thanks to Jouni for pointing out, that pre-auth frames should be handled as ordinary data frames.

Markus Theil committed 6 years ago

Commit 5631d961 parent 5d44fe72 files · +13 −1Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/nl80211.h+12−1
@@ -1632,7 +1632,8 @@ enum nl80211_commands { · 1631 unmodified lines
1632 * flag is included, then control port frames are sent over NL80211 instead1632 * flag is included, then control port frames are sent over NL80211 instead
1633 * using %CMD_CONTROL_PORT_FRAME. If control port routing over NL80211 is1633 * using %CMD_CONTROL_PORT_FRAME. If control port routing over NL80211 is
1634 * to be used then userspace must also use the %NL80211_ATTR_SOCKET_OWNER1634 * to be used then userspace must also use the %NL80211_ATTR_SOCKET_OWNER
1635 * flag.1635 * flag. When used with %NL80211_ATTR_CONTROL_PORT_NO_PREAUTH, pre-auth
1636 * frames are not forwared over the control port.
1636 *1637 *
1637 * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver.1638 * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver.
1638 * We recommend using nested, driver-specific attributes within this.1639 * We recommend using nested, driver-specific attributes within this.
@@ -2442,6 +2443,9 @@ enum nl80211_commands { · 803 unmodified lines
2442 * on output (in wiphy attributes) it contains only the feature sub-2443 * on output (in wiphy attributes) it contains only the feature sub-
2443 * attributes.2444 * attributes.
2444 *2445 *
2446 * @NL80211_ATTR_CONTROL_PORT_NO_PREAUTH: disable preauth frame rx on control
2447 * port in order to forward/receive them as ordinary data frames.
2448 *
2445 * @NUM_NL80211_ATTR: total number of nl80211_attrs available2449 * @NUM_NL80211_ATTR: total number of nl80211_attrs available
2446 * @NL80211_ATTR_MAX: highest attribute number currently defined2450 * @NL80211_ATTR_MAX: highest attribute number currently defined
2447 * @__NL80211_ATTR_AFTER_LAST: internal use2451 * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2912,6 +2916,8 @@ enum nl80211_attrs { · 464 unmodified lines
2912 2916
2913 NL80211_ATTR_TID_CONFIG,2917 NL80211_ATTR_TID_CONFIG,
2914 2918
2919 NL80211_ATTR_CONTROL_PORT_NO_PREAUTH,
2920
2915 /* add attributes here, update the policy in nl80211.c */2921 /* add attributes here, update the policy in nl80211.c */
2916 2922
2917 __NL80211_ATTR_AFTER_LAST,2923 __NL80211_ATTR_AFTER_LAST,
@@ -5642,6 +5648,10 @@ enum nl80211_feature_flags { · 2724 unmodified lines
5642 * @NL80211_EXT_FEATURE_BEACON_PROTECTION: The driver supports Beacon protection5648 * @NL80211_EXT_FEATURE_BEACON_PROTECTION: The driver supports Beacon protection
5643 * and can receive key configuration for BIGTK using key indexes 6 and 7.5649 * and can receive key configuration for BIGTK using key indexes 6 and 7.
5644 *5650 *
5651 * @NL80211_EXT_FEATURE_CONTROL_PORT_NO_PREAUTH: The driver can disable the
5652 * forwarding of preauth frames over the control port. They are then
5653 * handled as ordinary data frames.
5654 *
5645 * @NUM_NL80211_EXT_FEATURES: number of extended features.5655 * @NUM_NL80211_EXT_FEATURES: number of extended features.
5646 * @MAX_NL80211_EXT_FEATURES: highest extended feature index.5656 * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
5647 */5657 */
@@ -5690,6 +5700,7 @@ enum nl80211_ext_feature_index { · 42 unmodified lines
5690 NL80211_EXT_FEATURE_VLAN_OFFLOAD,5700 NL80211_EXT_FEATURE_VLAN_OFFLOAD,
5691 NL80211_EXT_FEATURE_AQL,5701 NL80211_EXT_FEATURE_AQL,
5692 NL80211_EXT_FEATURE_BEACON_PROTECTION,5702 NL80211_EXT_FEATURE_BEACON_PROTECTION,
5703 NL80211_EXT_FEATURE_CONTROL_PORT_NO_PREAUTH,
5693 5704
5694 /* add new features before the definition below */5705 /* add new features before the definition below */
5695 NUM_NL80211_EXT_FEATURES,5706 NUM_NL80211_EXT_FEATURES,