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

Commit e63a59a4 authored by Ashish Kumar Dhanotiya's avatar Ashish Kumar Dhanotiya Committed by nshrivas
Browse files

qcacld-3.0: Check for the duplicate MAC during open adapter

Currently for STA mode in open adapter, locally administered
bit is getting reset, there is a possibility that after
resetting this locally administered bit this new MAC matches
to an existing MAC address which may result in multiple interfaces
to be up with same MAC address.

To avoid this issue, add a check for duplicate MAC address after
resetting locally administered bit.

Change-Id: I3ff8091df2c422bd89944ca39849c9961941e8c3
CRs-fixed: 2370349
parent f1fb9d45
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -5330,8 +5330,22 @@ struct hdd_adapter *hdd_open_adapter(struct hdd_context *hdd_ctx, uint8_t sessio

	switch (session_type) {
	case QDF_STA_MODE:
		if (!hdd_ctx->config->mac_provision)
		if (!hdd_ctx->config->mac_provision) {
			hdd_reset_locally_admin_bit(hdd_ctx, macAddr);
			/*
			 * After resetting locally administered bit
			 * again check if the new mac address is already
			 * exists.
			 */
			status = hdd_check_for_existing_macaddr(hdd_ctx,
								macAddr);
			if (QDF_STATUS_E_FAILURE == status) {
				hdd_err("Duplicate MAC addr: " MAC_ADDRESS_STR
					" already exists",
					MAC_ADDR_ARRAY(macAddr));
				return NULL;
			}
		}

	/* fall through */
	case QDF_P2P_CLIENT_MODE: