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.
This commit is contained in:
Ratchanan Srirattanamet 2022-10-26 02:16:27 +07:00 committed by Thomas Haller
parent e7809a2bd7
commit f914df4f79
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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)) {