Blame SOURCES/0018-rh1263959-modem-ip-families.patch

ab7d06
From eecb4c46cc35c43c12e84e530b3be50374baa792 Mon Sep 17 00:00:00 2001
ab7d06
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= <jklimes@redhat.com>
ab7d06
Date: Tue, 22 Sep 2015 18:42:40 +0200
ab7d06
Subject: [PATCH] modem-broadband: update modem's supported-ip-families (rh
ab7d06
 #1263959)
ab7d06
MIME-Version: 1.0
ab7d06
Content-Type: text/plain; charset=UTF-8
ab7d06
Content-Transfer-Encoding: 8bit
ab7d06
ab7d06
If SIM in a modem is locked, ModemManager can't initialize SupportedIpFamilies
ab7d06
and NetworkManager will set the property to 0. ModemManager then updates the
ab7d06
property after the modem is unlocked, but NetworkManager did not watch changes
ab7d06
to the property. And that resulted in a connection failure:
ab7d06
(ttyUSB1): Failed to connect 'O2 Internet': Connection requested IPv4 but IPv4 is unsuported by the modem.
ab7d06
(ttyUSB1): device state change: prepare -> failed (reason 'modem-init-failed') [40 120 28]
ab7d06
ab7d06
https://bugzilla.redhat.com/show_bug.cgi?id=1263959
ab7d06
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
ab7d06
---
ab7d06
 src/devices/wwan/nm-modem-broadband.c | 17 +++++++++++++++++
ab7d06
 1 file changed, 17 insertions(+)
ab7d06
ab7d06
diff --git a/src/devices/wwan/nm-modem-broadband.c b/src/devices/wwan/nm-modem-broadband.c
ab7d06
index e5c77f4..7ec90c3 100644
ab7d06
--- a/src/devices/wwan/nm-modem-broadband.c
ab7d06
+++ b/src/devices/wwan/nm-modem-broadband.c
ab7d06
@@ -1153,6 +1153,19 @@ sim_changed (MMModem *modem, GParamSpec *pspec, gpointer user_data)
ab7d06
 }
ab7d06
 
ab7d06
 static void
ab7d06
+supported_ip_families_changed (MMModem *modem, GParamSpec *pspec, gpointer user_data)
ab7d06
+{
ab7d06
+	NMModemBroadband *self = NM_MODEM_BROADBAND (user_data);
ab7d06
+
ab7d06
+	g_return_if_fail (modem == self->priv->modem_iface);
ab7d06
+
ab7d06
+	g_object_set (G_OBJECT (self),
ab7d06
+	              NM_MODEM_IP_TYPES,
ab7d06
+	              mm_ip_family_to_nm (mm_modem_get_supported_ip_families (modem)),
ab7d06
+	              NULL);
ab7d06
+}
ab7d06
+
ab7d06
+static void
ab7d06
 nm_modem_broadband_init (NMModemBroadband *self)
ab7d06
 {
ab7d06
 	self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
ab7d06
@@ -1183,6 +1196,10 @@ set_property (GObject *object,
ab7d06
 		                  G_CALLBACK (sim_changed),
ab7d06
 		                  self);
ab7d06
 		sim_changed (self->priv->modem_iface, NULL, self);
ab7d06
+		g_signal_connect (self->priv->modem_iface,
ab7d06
+		                  "notify::supported-ip-families",
ab7d06
+		                  G_CALLBACK (supported_ip_families_changed),
ab7d06
+		                  self);
ab7d06
 
ab7d06
 		/* Note: don't grab the Simple iface here; the Modem interface is the
ab7d06
 		 * only one assumed to be always valid and available */
ab7d06
-- 
ab7d06
2.1.0
ab7d06