Blob Blame History Raw
From 1173a2ad3fa3833b04af4023d0434e5de14638db Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Thu, 5 Nov 2015 14:39:07 +0100
Subject: [PATCH 1/4] build: add missing GLIB_CFLAGS

The library and the include paths are dragged in with DBUS_CFLAGS but we need
more; especially the GLIB_VERSION_{MIN/MAX}_REQUIRED macros. Otherwise we get
deprecation warnings.

No master commit, since this was fixed as a side-effect of the GDBus merge.

(cherry picked from commit 302914c010ae547eeb01520405bb2a55d7d30d7f)
---
 src/devices/bluetooth/Makefile.am | 1 +
 src/devices/wwan/Makefile.am      | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/devices/bluetooth/Makefile.am b/src/devices/bluetooth/Makefile.am
index 8ab561a..035f0e5 100644
--- a/src/devices/bluetooth/Makefile.am
+++ b/src/devices/bluetooth/Makefile.am
@@ -15,6 +15,7 @@ AM_CPPFLAGS = \
 	-DG_LOG_DOMAIN=\""NetworkManager-bluetooth"\" \
 	-DNETWORKMANAGER_COMPILATION \
 	-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
+	$(GLIB_CFLAGS) \
 	$(DBUS_CFLAGS)
 
 GLIB_GENERATED = nm-bt-enum-types.h nm-bt-enum-types.c
diff --git a/src/devices/wwan/Makefile.am b/src/devices/wwan/Makefile.am
index 7e5b190..bcc41cf 100644
--- a/src/devices/wwan/Makefile.am
+++ b/src/devices/wwan/Makefile.am
@@ -15,6 +15,7 @@ AM_CPPFLAGS = \
 	-DNETWORKMANAGER_COMPILATION \
 	-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
 	$(DBUS_CFLAGS) \
+	$(GLIB_CFLAGS) \
 	$(MM_GLIB_CFLAGS)
 
 BUILT_SOURCES = $(null)
-- 
2.5.0


From a21f00a1e3ff099aee72c23cb553881f216f3bf5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= <jklimes@redhat.com>
Date: Thu, 22 Oct 2015 10:17:20 +0200
Subject: [PATCH 2/4] wifi: do no crash when getting BSSID fails

https://bodhi.fedoraproject.org/updates/NetworkManager-1.0.6-7.fc23#comment-342089

(cherry picked from commit e9bc18d2a7befb032052555ffba22bc72c9b8c2f)
(cherry picked from commit e0e043ef3918de54f8d19a3af07d3367962970e5)
---
 src/devices/wifi/nm-device-wifi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c
index dde743b..fc6ff4d 100644
--- a/src/devices/wifi/nm-device-wifi.c
+++ b/src/devices/wifi/nm-device-wifi.c
@@ -1650,7 +1650,11 @@ try_fill_ssid_for_hidden_ap (NMAccessPoint *ap)
 	g_return_if_fail (nm_ap_get_ssid (ap) == NULL);
 
 	bssid = nm_ap_get_address (ap);
-	g_assert (bssid);
+	if (!bssid) {
+		nm_log_dbg (LOGD_WIFI, "failed to get BSSID for hidden AP %s",
+		            str_if_set (nm_ap_get_supplicant_path (ap), "(none)"));
+		return;
+	}
 
 	/* Look for this AP's BSSID in the seen-bssids list of a connection,
 	 * and if a match is found, copy over the SSID */
-- 
2.5.0


From befd1c8abf26bf57b23b9c07e05acafa6a617793 Mon Sep 17 00:00:00 2001
From: Dan Williams <dcbw@redhat.com>
Date: Tue, 10 Nov 2015 11:11:30 -0600
Subject: [PATCH 3/4] wifi: don't accept any BSSes with missing BSSIDs (rh
 #1276426)

The supplicant should never be sending us BSSes without BSSIDs.

https://bugzilla.redhat.com/show_bug.cgi?id=1276426
(cherry picked from commit 7cb323d92303df8c87d0c40c1c67b4d3a065275c)
(cherry picked from commit ebe3320e62e6f4068467f2410b93be2a05ff6d53)
---
 src/devices/wifi/nm-device-wifi.c | 2 +-
 src/devices/wifi/nm-wifi-ap.c     | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c
index fc6ff4d..1cf221a 100644
--- a/src/devices/wifi/nm-device-wifi.c
+++ b/src/devices/wifi/nm-device-wifi.c
@@ -1876,7 +1876,7 @@ supplicant_iface_new_bss_cb (NMSupplicantInterface *iface,
 		merge_scanned_ap (self, ap);
 		g_object_unref (ap);
 	} else
-		_LOGW (LOGD_WIFI_SCAN, "invalid AP properties received");
+		_LOGD (LOGD_WIFI_SCAN, "invalid AP properties received for %s", object_path);
 
 	/* Remove outdated access points */
 	schedule_scanlist_cull (self);
diff --git a/src/devices/wifi/nm-wifi-ap.c b/src/devices/wifi/nm-wifi-ap.c
index 1485f4c..7243002 100644
--- a/src/devices/wifi/nm-wifi-ap.c
+++ b/src/devices/wifi/nm-wifi-ap.c
@@ -476,9 +476,10 @@ nm_ap_new_from_properties (const char *supplicant_path, GVariant *properties)
 
 	nm_ap_set_supplicant_path (ap, supplicant_path);
 
-	/* ignore APs with invalid BSSIDs */
+	/* ignore APs with invalid or missing BSSIDs */
 	addr = nm_ap_get_address (ap);
-	if (   nm_utils_hwaddr_matches (addr, -1, bad_bssid1, ETH_ALEN)
+	if (   !addr
+	    || nm_utils_hwaddr_matches (addr, -1, bad_bssid1, ETH_ALEN)
 	    || nm_utils_hwaddr_matches (addr, -1, bad_bssid2, ETH_ALEN)) {
 		g_object_unref (ap);
 		return NULL;
-- 
2.5.0


From 37ce0397d2c6a0c80019b481059ced8d53d33d9b Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Wed, 11 Nov 2015 18:00:33 +0100
Subject: [PATCH 4/4] Revert "wifi: do no crash when getting BSSID fails"

Since commit ebe3320e62e6f4068467f2410b93be2a05ff6d53,
nm_ap_new_from_properties() will always return an
AP with BSSID set. Restore the assertion during
try_fill_ssid_for_hidden_ap().

This reverts commit e0e043ef3918de54f8d19a3af07d3367962970e5.

(cherry picked from commit d5373959f9245faeebb1ba32b5b2b688d073ee6c)
(cherry picked from commit 0ff3699af5aaf9e403964bf6b52db30f78e2f069)
---
 src/devices/wifi/nm-device-wifi.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c
index 1cf221a..192b22b 100644
--- a/src/devices/wifi/nm-device-wifi.c
+++ b/src/devices/wifi/nm-device-wifi.c
@@ -1650,11 +1650,7 @@ try_fill_ssid_for_hidden_ap (NMAccessPoint *ap)
 	g_return_if_fail (nm_ap_get_ssid (ap) == NULL);
 
 	bssid = nm_ap_get_address (ap);
-	if (!bssid) {
-		nm_log_dbg (LOGD_WIFI, "failed to get BSSID for hidden AP %s",
-		            str_if_set (nm_ap_get_supplicant_path (ap), "(none)"));
-		return;
-	}
+	g_return_if_fail (bssid);
 
 	/* Look for this AP's BSSID in the seen-bssids list of a connection,
 	 * and if a match is found, copy over the SSID */
-- 
2.5.0