Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47ce1b0d authored by Yeshwanth Sriram Guntuka's avatar Yeshwanth Sriram Guntuka Committed by Yingying Tang
Browse files

qcacld-3.0: Flush frags for peer on add key request

Fragments are not flushed as part of rekey which
could result in fragments encrypted under different
keys to be reassembled.

Fix is to flush fragments for the peer for which add
key request is received.

Change-Id: I0c018ff7375272125c62aaea7b8ad4df9e842508
CRs-Fixed: 2875950
parent beb4ede1
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2019, 2021 The Linux Foundation. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
@@ -15447,6 +15447,12 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
	QDF_STATUS qdf_ret_status;
	hdd_context_t *pHddCtx;
	hdd_ap_ctx_t *ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(pAdapter);
	ol_txrx_pdev_handle pdev = cds_get_context(QDF_MODULE_ID_TXRX);
	if (!pdev) {
		hdd_err("DP pdev is NULL");
		return -EINVAL;
	}
	ENTER();
@@ -15610,6 +15616,10 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
		setKey.keyDirection = eSIR_TX_RX;
		qdf_mem_copy(setKey.peerMac.bytes, mac_addr, QDF_MAC_ADDR_SIZE);
	}
	ol_txrx_peer_flush_frags(pdev, pAdapter->sessionId,
				 setKey.peerMac.bytes);
	if ((QDF_IBSS_MODE == pAdapter->device_mode) && !pairwise) {
		/* if a key is already installed, block all subsequent ones */
		if (pAdapter->sessionCtx.station.ibss_enc_key_installed) {