From f914df4f799f7d0b012afb914008077ee8355d1d Mon Sep 17 00:00:00 2001 From: Ratchanan Srirattanamet Date: Wed, 26 Oct 2022 02:16:27 +0700 Subject: [PATCH] wwan/ofono: avoid bogus IP failure when not connecting If modem is not at least "registered", a connection is not happening, which means IP settings change is probably not interesting. Avoid trying to parse it, so that we don't trigger connection failure when there isn't one. --- src/core/devices/wwan/nm-modem-ofono.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/devices/wwan/nm-modem-ofono.c b/src/core/devices/wwan/nm-modem-ofono.c index 3431179bcc..128de60636 100644 --- a/src/core/devices/wwan/nm-modem-ofono.c +++ b/src/core/devices/wwan/nm-modem-ofono.c @@ -1213,6 +1213,14 @@ handle_settings(NMModemOfono *self, GVariant *v_dict) * handle the action. */ + if (nm_modem_get_state(NM_MODEM(self)) < NM_MODEM_STATE_REGISTERED) { + /* + * Connection definitely isn't happening. Avoid trigering bogus + * failure which would put device in a wrong state. + */ + return; + } + _LOGI("IPv4 static Settings:"); if (!g_variant_lookup(v_dict, "Interface", "&s", &interface)) {