Skip to content

[th/modem-config-result-fix] core/wwan: avoid assertion failure in modem_ip{4,6}_config_result()

Thomas Haller requested to merge th/modem-config-result-fix into main

NMDeviceModem has priv->modem set from construction to dispose, and the NM_MODEM_IP4_CONFIG_RESULT/NM_MODEM_IP6_CONFIG_RESULT signals connected all the time.

On the other hand, NMModem may hook up to NMPPPManager's NM_PPP_MANAGER_SIGNAL_IP{4,6}_CONFIG signals, which emit the config-results signals. And PPP manager emits the config signals from impl_ppp_manager_set_ip{4,6}_config().

That means, at any moment can be a D-Bus calls, which leads to emitting those signals and calling into modem_ip4_config_result() and modem_ip6_config_result().

At least, it's not clear from review what would prevent that from happening. If you cannot easily verify that certain conditions are satisfied, then this is not the place to assert, but to handle the case as something that can happen regularly.

Handle signals in the unexpected state by ignoring them.

https://bugzilla.redhat.com/show_bug.cgi?id=1916192

Edited by Thomas Haller

Merge request reports

Loading