From c35cf29a425087f522baa5766fc4c2fe0377223b Mon Sep 17 00:00:00 2001 From: Yeshwanth Sriram Guntuka Date: Tue, 3 Mar 2020 12:18:55 +0530 Subject: [PATCH] qcacld-3.0: Use appropriate mac addr when fetching sta info In SAP mode, as part of dhcp inspection, sta info is fetched using the source address of the packet irrespective of direction. This results in sta info fetch failure in case of dhcp tx frames where source address is self mac address which is not registered as part of SAP start. Due to this, when sending dhcp ack frame, tx comp flag is not set in nbuf cb causing dhcp stop ind to be not sent to firmware. Fix is to use dhcp client mac address to fetch sta info. Change-Id: Ia61b93d24f3d069b40fe8ffa5ee7b6ba1e30e7c5 CRs-Fixed: 2632275 --- core/hdd/src/wlan_hdd_softap_tx_rx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_softap_tx_rx.c b/core/hdd/src/wlan_hdd_softap_tx_rx.c index 9c9f7e3dca..812e119ead 100644 --- a/core/hdd/src/wlan_hdd_softap_tx_rx.c +++ b/core/hdd/src/wlan_hdd_softap_tx_rx.c @@ -319,8 +319,7 @@ int hdd_softap_inspect_dhcp_packet(struct hdd_adapter *adapter, enum qdf_proto_subtype subtype = QDF_PROTO_INVALID; struct hdd_station_info *hdd_sta_info; int errno = 0; - struct qdf_mac_addr *src_mac, *macaddr = - (struct qdf_mac_addr *)(skb->data + QDF_NBUF_SRC_MAC_OFFSET); + struct qdf_mac_addr *src_mac; if (((adapter->device_mode == QDF_SAP_MODE) || (adapter->device_mode == QDF_P2P_GO_MODE)) && @@ -333,8 +332,7 @@ int hdd_softap_inspect_dhcp_packet(struct hdd_adapter *adapter, subtype = qdf_nbuf_get_dhcp_subtype(skb); hdd_sta_info = hdd_get_sta_info_by_mac(&adapter->sta_info_list, - macaddr->bytes); - + src_mac->bytes); if (!hdd_sta_info) { hdd_debug("Station not found"); return -EINVAL;