Merge changes from topic "update_mac_addr_netdev_state_change"

* changes:
  Fix for SAE connection failure due to SAE frame drop
  Revert "Add update of mac address to supplicant"
  Revert "Fix defining FEATURE_UPDATE_STA_MAC_ADDR"
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 51674f0..204099b 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -1200,6 +1200,10 @@
 			wpa_supplicant_event(drv->ctx, EVENT_INTERFACE_ENABLED,
 					     NULL);
 		}
+	} else if (ifi->ifi_flags & IFF_UP) {
+		/* Re-read MAC address as it may have changed */
+		nl80211_refresh_mac(drv, ifi->ifi_index, 1);
+		return;
 	}
 
 	/*
diff --git a/wpa_supplicant/Android.mk b/wpa_supplicant/Android.mk
index ed20fb3..5cc9c65 100644
--- a/wpa_supplicant/Android.mk
+++ b/wpa_supplicant/Android.mk
@@ -68,10 +68,6 @@
 L_CFLAGS += -DCONFIG_NO_ROAMING
 endif
 
-ifeq ($(WIFI_UPDATE_SUPPLICANT_MAC_ADDR), enabled)
-L_CFLAGS += -DFEATURE_UPDATE_STA_MAC_ADDR
-endif
-
 # Use Android specific directory for control interface sockets
 L_CFLAGS += -DCONFIG_CTRL_IFACE_CLIENT_DIR=\"/data/vendor/wifi/wpa/sockets\"
 L_CFLAGS += -DCONFIG_CTRL_IFACE_DIR=\"/data/vendor/wifi/wpa/sockets\"
diff --git a/wpa_supplicant/hidl/1.4/sta_network.cpp b/wpa_supplicant/hidl/1.4/sta_network.cpp
index 35524f7..a87c9eb 100644
--- a/wpa_supplicant/hidl/1.4/sta_network.cpp
+++ b/wpa_supplicant/hidl/1.4/sta_network.cpp
@@ -1927,11 +1927,6 @@
 	struct wpa_supplicant *wpa_s = retrieveIfacePtr();
 	wpa_s->scan_min_time.sec = 0;
 	wpa_s->scan_min_time.usec = 0;
-#ifdef FEATURE_UPDATE_STA_MAC_ADDR
-	// Make sure that the supplicant is updated to the latest
-	// MAC address, which might have changed due to MAC randomization.
-	wpa_supplicant_update_mac_addr(wpa_s);
-#endif
 	wpa_supplicant_select_network(wpa_s, wpa_ssid);
 	return {SupplicantStatusCode::SUCCESS, ""};
 }