qcacmn: Add check to discard multicast echo packets

The bridge forwards the multicast packets to all the
interfaces attached the bridge.

When the STA network interface receives such packets
from bridge and send it to the AP, it is echoed back
from the BSS.

These packets are not intended for the bridge as it
will lead to looping.

Add a check to detect and drop such packets when
received back from the BSS.

Refactor dp_rx_mcast_echo_check function to fix
compilation errors from the above change.

CRs-Fixed: 2894272
Change-Id: I3f9e92c3598af11d3ff4e6b9b8afbc4110a926fc
This commit is contained in:
Subrat Dash
2021-02-17 20:14:52 +05:30
gecommit door snandini
bovenliggende 1807be0f1e
commit ecb559ab6f
3 gewijzigde bestanden met toevoegingen van 74 en 28 verwijderingen

Bestand weergeven

@@ -1694,4 +1694,32 @@ dp_rx_deliver_to_pkt_capture_no_peer(struct dp_soc *soc, qdf_nbuf_t nbuf,
{
}
#endif
#ifndef QCA_HOST_MODE_WIFI_DISABLED
#ifdef FEATURE_MEC
/**
* dp_rx_mcast_echo_check() - check if the mcast pkt is a loop
* back on same vap or a different vap.
* @soc: core DP main context
* @peer: dp peer handler
* @rx_tlv_hdr: start of the rx TLV header
* @nbuf: pkt buffer
*
* Return: bool (true if it is a looped back pkt else false)
*
*/
bool dp_rx_mcast_echo_check(struct dp_soc *soc,
struct dp_peer *peer,
uint8_t *rx_tlv_hdr,
qdf_nbuf_t nbuf);
#else
static inline bool dp_rx_mcast_echo_check(struct dp_soc *soc,
struct dp_peer *peer,
uint8_t *rx_tlv_hdr,
qdf_nbuf_t nbuf)
{
return false;
}
#endif /* FEATURE_MEC */
#endif /* QCA_HOST_MODE_WIFI_DISABLED */
#endif /* _DP_RX_H */