qcacld-3.0: Avoid duplicate MAC configuration

Currently if the MAC is changed dynamically for any interface,
driver is allowing to configure a MAC which is already in use by
some other interface and it will allow different interfaces to
come up on same MAC address.

To address this issue add a check to configfure only different
MAC address.

Change-Id: Iece3bb063be30d5d983f4bec710d6d16b22bd2f9
CRs-Fixed: 2227656
This commit is contained in:
Ashish Kumar Dhanotiya
2018-04-19 16:03:15 +05:30
committed by nshrivas
szülő 703b24f9e8
commit f974f3355f
2 fájl változott, egészen pontosan 12 új sor hozzáadva és 0 régi sor törölve

Fájl megtekintése

@@ -680,6 +680,12 @@ static int __hdd_hostapd_set_mac_address(struct net_device *dev, void *addr)
qdf_mem_copy(&mac_addr, psta_mac_addr->sa_data, sizeof(mac_addr));
if (hdd_get_adapter_by_macaddr(hdd_ctx, mac_addr.bytes)) {
hdd_err("adapter exist with same mac address " MAC_ADDRESS_STR,
MAC_ADDR_ARRAY(mac_addr.bytes));
return -EINVAL;
}
if (qdf_is_macaddr_zero(&mac_addr)) {
hdd_err("MAC is all zero");
return -EINVAL;

Fájl megtekintése

@@ -3260,6 +3260,12 @@ static int __hdd_set_mac_address(struct net_device *dev, void *addr)
qdf_mem_copy(&mac_addr, psta_mac_addr->sa_data, sizeof(mac_addr));
if (hdd_get_adapter_by_macaddr(hdd_ctx, mac_addr.bytes)) {
hdd_err("adapter exist with same mac address " MAC_ADDRESS_STR,
MAC_ADDR_ARRAY(mac_addr.bytes));
return -EINVAL;
}
if (qdf_is_macaddr_zero(&mac_addr)) {
hdd_err("MAC is all zero");
return -EINVAL;