History

Revert "nl80211: add src and dst addr attributes for control port tx/rx"

This reverts commit 8c3ed7aa2b9ef666195b789e9b02e28383243fa8. As Jouni points out, there's really no need for this, since the RSN pre-authentication frames are normal data frames, not port control frames (locally). We can still revert this now since it hasn't actually gone beyond -next.

Johannes Berg committed 6 years ago

Commit 8d74a621 parent 8079e4f7 files · +21 −57Browse files

Unified · Split

7 files
  1. include/net/cfg80211.h +1 −2
  2. include/uapi/linux/nl80211.h +1 −15
  3. net/mac80211/ieee80211_i.h +1 −2
  4. net/mac80211/tx.c +1 −2
  5. net/wireless/nl80211.c +3 −15
  6. net/wireless/rdev-ops.h +4 −4
  7. net/wireless/trace.h +10 −17
include/net/cfg80211.h+1−2
@@ -3974,8 +3974,7 @@ struct cfg80211_ops { · 3973 unmodified lines
39743974 int (*tx_control_port)(struct wiphy *wiphy,
39753975 struct net_device *dev,
39763976 const u8 *buf, size_t len,
3977− const u8 *dest, const u8 *src,
3978− const __be16 proto,
3977+ const u8 *dest, const __be16 proto,
39793978 const bool noencrypt);
39803979
39813980 int (*get_ftm_responder_stats)(struct wiphy *wiphy,
include/uapi/linux/nl80211.h+1−15
@@ -1039,14 +1039,11 @@ · 1038 unmodified lines
10391039 * a control port frame and as a notification that a control port frame
10401040 * has been received. %NL80211_ATTR_FRAME is used to specify the
10411041 * frame contents. The frame is the raw EAPoL data, without ethernet or
1042− * 802.11 headers. An optional %NL80211_ATTR_SRC_MAC can be used to send
1043− * pre-auth frames to STAs on behalf of other APs.
1042+ * 802.11 headers.
10441043 * When used as an event indication %NL80211_ATTR_CONTROL_PORT_ETHERTYPE,
10451044 * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT and %NL80211_ATTR_MAC are added
10461045 * indicating the protocol type of the received frame; whether the frame
10471046 * was received unencrypted and the MAC address of the peer respectively.
1048− * %NL80211_ATTR_DST_MAC can be used to forward pre-auth frames in
1049− * userspace while using AP mode.
10501047 *
10511048 * @NL80211_CMD_RELOAD_REGDB: Request that the regdb firmware file is reloaded.
10521049 *
@@ -2412,9 +2409,6 @@ enum nl80211_commands { · 1359 unmodified lines
24122409 * %NL80211_ATTR_AKM_SUITES are default capabilities if AKM suites not
24132410 * advertised for a specific interface type.
24142411 *
2415− * @NL80211_ATTR_SRC_MAC: MAC address used in control port over nl80211 transmit
2416− * @NL80211_ATTR_DST_MAC: MAC address used in control port over nl80211 receive
2417− *
24182412 * @NUM_NL80211_ATTR: total number of nl80211_attrs available
24192413 * @NL80211_ATTR_MAX: highest attribute number currently defined
24202414 * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2883,9 +2877,6 @@ enum nl80211_attrs { · 462 unmodified lines
28832877
28842878 NL80211_ATTR_IFTYPE_AKM_SUITES,
28852879
2886− NL80211_ATTR_SRC_MAC,
2887− NL80211_ATTR_DST_MAC,
2888−
28892880 /* add attributes here, update the policy in nl80211.c */
28902881
28912882 __NL80211_ATTR_AFTER_LAST,
@@ -5548,10 +5539,6 @@ enum nl80211_feature_flags { · 2656 unmodified lines
55485539 * feature, which prevents bufferbloat by using the expected transmission
55495540 * time to limit the amount of data buffered in the hardware.
55505541 *
5551− * @NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211_MAC_ADDRS: The driver
5552− * can use src and dst MAC addresses with control port over nl80211 rx
5553− * and tx operations.
5554− *
55555542 * @NUM_NL80211_EXT_FEATURES: number of extended features.
55565543 * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
55575544 */
@@ -5599,7 +5586,6 @@ enum nl80211_ext_feature_index { · 41 unmodified lines
55995586 NL80211_EXT_FEATURE_SAE_OFFLOAD,
56005587 NL80211_EXT_FEATURE_VLAN_OFFLOAD,
56015588 NL80211_EXT_FEATURE_AQL,
5602− NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211_MAC_ADDRS,
56035589
56045590 /* add new features before the definition below */
56055591 NUM_NL80211_EXT_FEATURES,
net/mac80211/ieee80211_i.h+1−2
@@ -1792,8 +1792,7 @@ void ieee80211_check_fast_xmit_iface(struct ieee80211_sub_if_data *sdata); · 1791 unmodified lines
17921792 void ieee80211_clear_fast_xmit(struct sta_info *sta);
17931793 int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
17941794 const u8 *buf, size_t len,
1795− const u8 *dest, const u8 *src, __be16 proto,
1796− bool unencrypted);
1795+ const u8 *dest, __be16 proto, bool unencrypted);
17971796 int ieee80211_probe_mesh_link(struct wiphy *wiphy, struct net_device *dev,
17981797 const u8 *buf, size_t len);
17991798
net/mac80211/tx.c+1−2
@@ -5283,8 +5283,7 @@ void __ieee80211_tx_skb_tid_band(struct ieee80211_sub_if_data *sdata, · 5282 unmodified lines
52835283
52845284 int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
52855285 const u8 *buf, size_t len,
5286− const u8 *dest, const u8 *src, __be16 proto,
5287− bool unencrypted)
5286+ const u8 *dest, __be16 proto, bool unencrypted)
52885287 {
52895288 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
52905289 struct ieee80211_local *local = sdata->local;
net/wireless/nl80211.c+3−15
@@ -634,8 +634,6 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { · 633 unmodified lines
634634 [NL80211_ATTR_HE_OBSS_PD] = NLA_POLICY_NESTED(he_obss_pd_policy),
635635 [NL80211_ATTR_VLAN_ID] = NLA_POLICY_RANGE(NLA_U16, 1, VLAN_N_VID - 2),
636636 [NL80211_ATTR_HE_BSS_COLOR] = NLA_POLICY_NESTED(he_bss_color_policy),
637− [NL80211_ATTR_SRC_MAC] = NLA_POLICY_ETH_ADDR,
638− [NL80211_ATTR_DST_MAC] = NLA_POLICY_ETH_ADDR,
639637 };
640638
641639 /* policy for the key attributes */
@@ -13698,7 +13696,6 @@ static int nl80211_tx_control_port(struct sk_buff *skb, struct genl_info *info) · 13056 unmodified lines
1369813696 const u8 *buf;
1369913697 size_t len;
1370013698 u8 *dest;
13701− u8 src[ETH_ALEN];
1370213699 u16 proto;
1370313700 bool noencrypt;
1370413701 int err;
@@ -13736,13 +13733,6 @@ static int nl80211_tx_control_port(struct sk_buff *skb, struct genl_info *info) · 31 unmodified lines
1373613733 goto out;
1373713734 }
1373813735
13739− /* copy src address under wdev_lock, as we may copy wdev_address */
13740− if (info->attrs[NL80211_ATTR_SRC_MAC])
13741− ether_addr_copy(src,
13742− nla_data(info->attrs[NL80211_ATTR_SRC_MAC]));
13743− else
13744− ether_addr_copy(src, wdev_address(wdev));
13745−
1374613736 wdev_unlock(wdev);
1374713737
1374813738 buf = nla_data(info->attrs[NL80211_ATTR_FRAME]);
@@ -13753,7 +13743,7 @@ static int nl80211_tx_control_port(struct sk_buff *skb, struct genl_info *info) · 4 unmodified lines
1375313743 nla_get_flag(info->attrs[NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT]);
1375413744
1375513745 return rdev_tx_control_port(rdev, dev, buf, len,
13756− dest, src, cpu_to_be16(proto), noencrypt);
13746+ dest, cpu_to_be16(proto), noencrypt);
1375713747
1375813748 out:
1375913749 wdev_unlock(wdev);
@@ -16010,8 +16000,7 @@ static int __nl80211_rx_control_port(struct net_device *dev, · 2250 unmodified lines
1601016000 struct wireless_dev *wdev = dev->ieee80211_ptr;
1601116001 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
1601216002 struct ethhdr *ehdr = eth_hdr(skb);
16013− const u8 *daddr = ehdr->h_dest;
16014− const u8 *saddr = ehdr->h_source;
16003+ const u8 *addr = ehdr->h_source;
1601516004 u16 proto = be16_to_cpu(skb->protocol);
1601616005 struct sk_buff *msg;
1601716006 void *hdr;
@@ -16036,8 +16025,7 @@ static int __nl80211_rx_control_port(struct net_device *dev, · 18 unmodified lines
1603616025 nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) ||
1603716026 nla_put_u64_64bit(msg, NL80211_ATTR_WDEV, wdev_id(wdev),
1603816027 NL80211_ATTR_PAD) ||
16039− nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, saddr) ||
16040− nla_put(msg, NL80211_ATTR_DST_MAC, ETH_ALEN, daddr) ||
16028+ nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr) ||
1604116029 nla_put_u16(msg, NL80211_ATTR_CONTROL_PORT_ETHERTYPE, proto) ||
1604216030 (unencrypted && nla_put_flag(msg,
1604316031 NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT)))
net/wireless/rdev-ops.h+4−4
@@ -734,14 +734,14 @@ static inline int rdev_mgmt_tx(struct cfg80211_registered_device *rdev, · 733 unmodified lines
734734 static inline int rdev_tx_control_port(struct cfg80211_registered_device *rdev,
735735 struct net_device *dev,
736736 const void *buf, size_t len,
737− const u8 *dest, const u8 *src,
738− __be16 proto, const bool noencrypt)
737+ const u8 *dest, __be16 proto,
738+ const bool noencrypt)
739739 {
740740 int ret;
741741 trace_rdev_tx_control_port(&rdev->wiphy, dev, buf, len,
742− dest, src, proto, noencrypt);
742+ dest, proto, noencrypt);
743743 ret = rdev->ops->tx_control_port(&rdev->wiphy, dev, buf, len,
744− dest, src, proto, noencrypt);
744+ dest, proto, noencrypt);
745745 trace_rdev_return_int(&rdev->wiphy, ret);
746746 return ret;
747747 }
net/wireless/trace.h+10−17
@@ -1928,31 +1928,27 @@ TRACE_EVENT(rdev_mgmt_tx, · 1927 unmodified lines
19281928
19291929 TRACE_EVENT(rdev_tx_control_port,
19301930 TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
1931− const u8 *buf, size_t len,
1932− const u8 *dest, const u8 *src, __be16 proto,
1931+ const u8 *buf, size_t len, const u8 *dest, __be16 proto,
19331932 bool unencrypted),
1934− TP_ARGS(wiphy, netdev, buf, len, dest, src, proto, unencrypted),
1933+ TP_ARGS(wiphy, netdev, buf, len, dest, proto, unencrypted),
19351934 TP_STRUCT__entry(
19361935 WIPHY_ENTRY
19371936 NETDEV_ENTRY
19381937 MAC_ENTRY(dest)
1939− MAC_ENTRY(src)
1940− __field(u16, proto)
1938+ __field(__be16, proto)
19411939 __field(bool, unencrypted)
19421940 ),
19431941 TP_fast_assign(
19441942 WIPHY_ASSIGN;
19451943 NETDEV_ASSIGN;
19461944 MAC_ASSIGN(dest, dest);
1947− MAC_ASSIGN(src, src);
1948− __entry->proto = be16_to_cpu(proto);
1945+ __entry->proto = proto;
19491946 __entry->unencrypted = unencrypted;
19501947 ),
1951− TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", dest: " MAC_PR_FMT
1952− ", src: " MAC_PR_FMT ", proto: 0x%x, unencrypted: %s",
1953− WIPHY_PR_ARG, NETDEV_PR_ARG,
1954− MAC_PR_ARG(dest), MAC_PR_ARG(src),
1955− __entry->proto,
1948+ TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " MAC_PR_FMT ","
1949+ " proto: 0x%x, unencrypted: %s",
1950+ WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(dest),
1951+ be16_to_cpu(__entry->proto),
19561952 BOOL_TO_STR(__entry->unencrypted))
19571953 );
19581954
@@ -2844,7 +2840,6 @@ TRACE_EVENT(cfg80211_rx_control_port, · 885 unmodified lines
28442840 TP_STRUCT__entry(
28452841 NETDEV_ENTRY
28462842 __field(int, len)
2847− MAC_ENTRY(to)
28482843 MAC_ENTRY(from)
28492844 __field(u16, proto)
28502845 __field(bool, unencrypted)
@@ -2852,14 +2847,12 @@ TRACE_EVENT(cfg80211_rx_control_port, · 1 unmodified line
28522847 TP_fast_assign(
28532848 NETDEV_ASSIGN;
28542849 __entry->len = skb->len;
2855− MAC_ASSIGN(to, eth_hdr(skb)->h_dest);
28562850 MAC_ASSIGN(from, eth_hdr(skb)->h_source);
28572851 __entry->proto = be16_to_cpu(skb->protocol);
28582852 __entry->unencrypted = unencrypted;
28592853 ),
2860− TP_printk(NETDEV_PR_FMT ", len=%d, dest: " MAC_PR_FMT
2861− ", src: " MAC_PR_FMT ", proto: 0x%x, unencrypted: %s",
2862− NETDEV_PR_ARG, __entry->len, MAC_PR_ARG(to), MAC_PR_ARG(from),
2854+ TP_printk(NETDEV_PR_FMT ", len=%d, " MAC_PR_FMT ", proto: 0x%x, unencrypted: %s",
2855+ NETDEV_PR_ARG, __entry->len, MAC_PR_ARG(from),
28632856 __entry->proto, BOOL_TO_STR(__entry->unencrypted))
28642857 );
28652858