Skip to content

Commit b7ed85c

Browse files
WifiConnectionManager: PreScan Check for Connect
When the Wifi network is enabled the connection manager will trigger a network scan without a profile to use. If there is a connected network or attempting a connection, the scan will interrupt and break the connection. Fix - The Wifi Connection Manager will check for SSID length longer than the minimum SSID length, and if the state is not in connecting or connected. Only of SSID string length is over the defined minimum and state are not connected then it will attempt the network scan as normal. Signed-off-by: Zachary Clark-Williams <[email protected]>
1 parent 2cff874 commit b7ed85c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrImpl.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,6 +1491,12 @@ WifiMgrOnTimerTick (
14911491
Nic = (WIFI_MGR_DEVICE_DATA *)Context;
14921492
NET_CHECK_SIGNATURE (Nic, WIFI_MGR_DEVICE_DATA_SIGNATURE);
14931493

1494+
if (StrLen (Nic->ConnectPendingNetwork->SSId) < SSID_MIN_LEN || Nic->ConnectState == WifiMgrConnectedToAp || Nic->ConnectState == WifiMgrConnectingToAp) {
1495+
DEBUG ((DEBUG_INFO, "[WiFi Connection Manager] Already connected or SSID not valid, no scan triggered!\n"));
1496+
gBS->CloseEvent (Event);
1497+
return;
1498+
}
1499+
14941500
Status = WifiMgrGetLinkState (Nic, &LinkState);
14951501
if (EFI_ERROR (Status)) {
14961502
DEBUG ((DEBUG_INFO, "[WiFi Connection Manager] Error: Failed to get link state!\n"));

0 commit comments

Comments
 (0)