|
@@ -976,6 +976,33 @@ wlan_ipa_send_skb_to_network(qdf_nbuf_t skb,
|
|
|
ipa_ctx->ipa_rx_net_send_count++;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * wlan_ipa_eapol_intrabss_fwd_check() - Check if eapol pkt intrabss fwd is
|
|
|
+ * allowed or not
|
|
|
+ * @ipa_ctx: IPA global context
|
|
|
+ * @vdev_id: vdev id
|
|
|
+ * @nbuf: network buffer
|
|
|
+ *
|
|
|
+ * Return: true if intrabss fwd is allowed for eapol else false
|
|
|
+ */
|
|
|
+static bool
|
|
|
+wlan_ipa_eapol_intrabss_fwd_check(struct wlan_ipa_priv *ipa_ctx,
|
|
|
+ uint8_t vdev_id, qdf_nbuf_t nbuf)
|
|
|
+{
|
|
|
+ uint8_t *vdev_mac_addr;
|
|
|
+
|
|
|
+ vdev_mac_addr = cdp_get_vdev_mac_addr(ipa_ctx->dp_soc, vdev_id);
|
|
|
+
|
|
|
+ if (!vdev_mac_addr)
|
|
|
+ return false;
|
|
|
+
|
|
|
+ if (qdf_mem_cmp(qdf_nbuf_data(nbuf) + QDF_NBUF_DEST_MAC_OFFSET,
|
|
|
+ vdev_mac_addr, QDF_MAC_ADDR_SIZE))
|
|
|
+ return false;
|
|
|
+
|
|
|
+ return true;
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* __wlan_ipa_w2i_cb() - WLAN to IPA callback handler
|
|
|
* @priv: pointer to private data registered with IPA (we register a
|
|
@@ -1052,9 +1079,21 @@ static void __wlan_ipa_w2i_cb(void *priv, qdf_ipa_dp_evt_type_t evt,
|
|
|
QDF_NBUF_SRC_MAC_OFFSET,
|
|
|
QDF_MAC_ADDR_SIZE);
|
|
|
|
|
|
- if (qdf_nbuf_is_ipv4_eapol_pkt(skb) ||
|
|
|
- qdf_nbuf_is_ipv4_wapi_pkt(skb))
|
|
|
+ if (qdf_nbuf_is_ipv4_eapol_pkt(skb)) {
|
|
|
is_eapol_wapi = true;
|
|
|
+ if (iface_context->device_mode == QDF_SAP_MODE &&
|
|
|
+ !wlan_ipa_eapol_intrabss_fwd_check(ipa_ctx,
|
|
|
+ iface_context->session_id, skb)) {
|
|
|
+ ipa_err_rl("EAPOL intrabss fwd drop DA:" QDF_MAC_ADDR_FMT,
|
|
|
+ QDF_MAC_ADDR_REF(qdf_nbuf_data(skb) +
|
|
|
+ QDF_NBUF_DEST_MAC_OFFSET));
|
|
|
+ ipa_ctx->ipa_rx_internal_drop_count++;
|
|
|
+ dev_kfree_skb_any(skb);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } else if (qdf_nbuf_is_ipv4_wapi_pkt(skb)) {
|
|
|
+ is_eapol_wapi = true;
|
|
|
+ }
|
|
|
|
|
|
/*
|
|
|
* Check for peer authorized state before allowing
|