Commit 67d30bc4 authored by Zeeshan Ali's avatar Zeeshan Ali

wifi: Ignore APs lacking SSID

Handle the case when SSID from nm_access_point_get_ssid is NULL.
parent d567ae26
......@@ -141,14 +141,15 @@ should_ignore_ap (NMAccessPoint *ap)
const GByteArray *ssid;
ssid = nm_access_point_get_ssid (ap);
if (ssid->len >= 6 &&
ssid->data[ssid->len - 1] == 'p' &&
ssid->data[ssid->len - 2] == 'a' &&
ssid->data[ssid->len - 3] == 'm' &&
ssid->data[ssid->len - 4] == 'o' &&
ssid->data[ssid->len - 5] == 'n' &&
ssid->data[ssid->len - 6] == '_') {
g_debug ("WiFi AP '%s' has '_nomap' suffix in its SSID."
if (ssid == NULL ||
(ssid->len >= 6 &&
ssid->data[ssid->len - 1] == 'p' &&
ssid->data[ssid->len - 2] == 'a' &&
ssid->data[ssid->len - 3] == 'm' &&
ssid->data[ssid->len - 4] == 'o' &&
ssid->data[ssid->len - 5] == 'n' &&
ssid->data[ssid->len - 6] == '_')) {
g_debug ("SSID for WiFi AP '%s' missing or has '_nomap' suffix."
", Ignoring..",
nm_access_point_get_bssid (ap));
return TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment