From 331d44afa69f808a32f5fb2e3ea43fc11da862b1 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sun, 12 Aug 2018 15:08:45 +0200 Subject: [PATCH] wifi: don't ignore trailing NUL byte when comparing SSID nm_utils_same_ssid() has a comment * Earlier versions of the Linux kernel added a NULL byte to the end of the * SSID to enable easy printing of the SSID on the console or in a terminal, * but this behavior was problematic (SSIDs are simply byte arrays, not strings) * and thus was changed. This function compensates for that behavior at the * cost of some compatibility with odd SSIDs that may legitimately have trailing * NULLs, even though that is functionally pointless. and the functionality was introduced by commit ccb13f0bdd0c8ac3ee85dd0a6064c9bc545585f1. There was only place left that calls nm_utils_same_ssid(). I really don't think this is the right approach, nor is it clear that this is still necessary. Also, it seems to only matter with WEXT, and we should not have such an ugly hack in all cases. --- src/devices/wifi/nm-wifi-ap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/wifi/nm-wifi-ap.c b/src/devices/wifi/nm-wifi-ap.c index d299d10234..f40f7191e3 100644 --- a/src/devices/wifi/nm-wifi-ap.c +++ b/src/devices/wifi/nm-wifi-ap.c @@ -1039,7 +1039,7 @@ nm_wifi_ap_check_compatible (NMWifiAP *self, if ( ssid && priv->ssid && !nm_utils_same_ssid (g_bytes_get_data (ssid, NULL), g_bytes_get_size (ssid), priv->ssid->data, priv->ssid->len, - TRUE)) + FALSE)) return FALSE; bssid = nm_setting_wireless_get_bssid (s_wireless);