wifi: mac80211: Allow EAPOL tx from specific link
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Thu, 30 Jun 2022 13:43:44 +0000 (16:43 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 15 Jul 2022 09:43:20 +0000 (11:43 +0200)
Allow link source address on TX.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/ieee80211_i.h
net/mac80211/rx.c
net/mac80211/tx.c

index 58b08315fa265bea0f92742d80a59575e878be6e..163e62dab0457010ff48f1d2bff55dfbb7687ea3 100644 (file)
@@ -1752,6 +1752,9 @@ void __ieee80211_check_fast_rx_iface(struct ieee80211_sub_if_data *sdata);
 void ieee80211_check_fast_rx_iface(struct ieee80211_sub_if_data *sdata);
 void ieee80211_clear_fast_rx(struct sta_info *sta);
 
+bool ieee80211_is_our_addr(struct ieee80211_sub_if_data *sdata,
+                          const u8 *addr, int *out_link_id);
+
 /* STA code */
 void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata);
 int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
index 1c798c11648e7e636fed960a1f2d4f4cba50631d..9f1ea8c840e9d2b92ef77e104a0e898ad47914d2 100644 (file)
@@ -2532,8 +2532,8 @@ __ieee80211_data_to_8023(struct ieee80211_rx_data *rx, bool *port_control)
        return 0;
 }
 
-static bool ieee80211_is_our_addr(struct ieee80211_sub_if_data *sdata,
-                                 const u8 *addr, int *out_link_id)
+bool ieee80211_is_our_addr(struct ieee80211_sub_if_data *sdata,
+                          const u8 *addr, int *out_link_id)
 {
        unsigned int link_id;
 
index 8f25cfe0d54382ccfed7c68203edccbab0945631..9d91a5f280445a9ce520319f13bbe3661ec8912d 100644 (file)
@@ -2781,7 +2781,7 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata,
                     (sdata->vif.type != NL80211_IFTYPE_OCB) &&
                     !multicast && !authorized &&
                     (cpu_to_be16(ethertype) != sdata->control_port_protocol ||
-                     !ether_addr_equal(sdata->vif.addr, skb->data + ETH_ALEN)))) {
+                     !ieee80211_is_our_addr(sdata, skb->data + ETH_ALEN, NULL)))) {
 #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
                net_info_ratelimited("%s: dropped frame to %pM (unauthorized port)\n",
                                    sdata->name, hdr.addr1);