Skip to content

Commit e258cb7

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 5bc52de commit e258cb7

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrImpl.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,8 +1489,26 @@ WifiMgrOnTimerTick (
14891489
}
14901490

14911491
Nic = (WIFI_MGR_DEVICE_DATA *)Context;
1492+
if (Nic->ConnectPendingNetwork == NULL) {
1493+
DEBUG ((DEBUG_INFO, "[WiFi Connection Manager] No profile for connection, no scan triggered!\n"));
1494+
gBS->CloseEvent (Event);
1495+
return;
1496+
}
1497+
1498+
if (StrLen (Nic->ConnectPendingNetwork->SSId) < SSID_MIN_LEN) {
1499+
DEBUG ((DEBUG_INFO, "[WiFi Connection Manager] Invalid SSID length for connection, no scan triggered!\n"));
1500+
gBS->CloseEvent (Event);
1501+
return;
1502+
}
1503+
14921504
NET_CHECK_SIGNATURE (Nic, WIFI_MGR_DEVICE_DATA_SIGNATURE);
14931505

1506+
if ((Nic->ConnectState == WifiMgrConnectedToAp) || (Nic->ConnectState == WifiMgrConnectingToAp)) {
1507+
DEBUG ((DEBUG_INFO, "[WiFi Connection Manager] Already connecting to AP, no scan triggered!\n"));
1508+
gBS->CloseEvent (Event);
1509+
return;
1510+
}
1511+
14941512
Status = WifiMgrGetLinkState (Nic, &LinkState);
14951513
if (EFI_ERROR (Status)) {
14961514
DEBUG ((DEBUG_INFO, "[WiFi Connection Manager] Error: Failed to get link state!\n"));

0 commit comments

Comments
 (0)