Browse Source

qcacld-3.0: Add MLD address check for received EAPOL packet

Currently the DA for EAPOl packets is being compared
with the adapter mac address. For MLO connection, the
EAPOL frames are exchanges using MLD mac address and
not the link address. hence this leads to drop of all
the EAPOL packets in receive path.

Add MLD address check for received EAPOL frames.

Change-Id: If158da1338169958c5a74cfb7ee125d7365a8202
CRs-Fixed: 3039333
Rakesh Pillai 3 years ago
parent
commit
4c1ead24e4
2 changed files with 31 additions and 4 deletions
  1. 29 0
      core/hdd/inc/wlan_hdd_main.h
  2. 2 4
      core/hdd/src/wlan_hdd_softap_tx_rx.c

+ 29 - 0
core/hdd/inc/wlan_hdd_main.h

@@ -4806,6 +4806,35 @@ hdd_monitor_mode_qdf_create_event(struct hdd_adapter *adapter,
 }
 #endif
 
+static inline bool hdd_is_mac_addr_same(uint8_t *addr1, uint8_t *addr2)
+{
+	return !qdf_mem_cmp(addr1, addr2, QDF_MAC_ADDR_SIZE);
+}
+
+#ifdef DP_FEATURE_11BE_MLO
+static inline bool hdd_nbuf_dst_addr_is_mld_addr(struct hdd_adapter *adapter,
+						 struct sk_buff *nbuf)
+{
+	return hdd_is_mac_addr_same(adapter->mld_addr.bytes,
+				    qdf_nbuf_data(nbuf) +
+				    QDF_NBUF_DEST_MAC_OFFSET);
+}
+#else
+static inline bool hdd_nbuf_dst_addr_is_mld_addr(struct hdd_adapter *adapter,
+						 struct sk_buff *nbuf)
+{
+	return false;
+}
+#endif
+
+static inline bool hdd_nbuf_dst_addr_is_self_addr(struct hdd_adapter *adapter,
+						  struct sk_buff *nbuf)
+{
+	return hdd_is_mac_addr_same(adapter->mac_addr.bytes,
+				    qdf_nbuf_data(nbuf) +
+				    QDF_NBUF_DEST_MAC_OFFSET);
+}
+
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)) && \
      defined(WLAN_FEATURE_11AX)
 /**

+ 2 - 4
core/hdd/src/wlan_hdd_softap_tx_rx.c

@@ -1178,10 +1178,8 @@ QDF_STATUS hdd_softap_rx_packet_cbk(void *adapter_context, qdf_nbuf_t rx_buf)
 			is_eapol = true;
 
 		if (qdf_unlikely(is_eapol &&
-				 qdf_mem_cmp(qdf_nbuf_data(skb) +
-					     QDF_NBUF_DEST_MAC_OFFSET,
-					     adapter->mac_addr.bytes,
-					     QDF_MAC_ADDR_SIZE))) {
+		    !(hdd_nbuf_dst_addr_is_self_addr(adapter, skb) ||
+		    hdd_nbuf_dst_addr_is_mld_addr(adapter, skb)))) {
 			qdf_nbuf_free(skb);
 			continue;
 		}