wwan: fix wrong connection cast on device state change

nm_settings_connection_set_autoconnect_blocked_reason() must be called
on the settings-connection. Fixes the following:

GLib-GObject-WARNING **: invalid cast from 'NMSimpleConnection' to 'NMSettingsConnection'

Fixes: 06da353242
This commit is contained in:
Beniamino Galvani 2016-10-26 12:06:39 +02:00
parent d860ccfc7b
commit 7034ea7aa3

View file

@ -363,7 +363,7 @@ device_state_changed (NMDevice *device,
{
NMDeviceModem *self = NM_DEVICE_MODEM (device);
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (self);
NMConnection *connection = nm_device_get_applied_connection (device);
NMSettingsConnection *connection = nm_device_get_settings_connection (device);
g_assert (priv->modem);
@ -390,7 +390,7 @@ device_state_changed (NMDevice *device,
* where a retry attempt would just fail again.
*/
if (connection)
nm_settings_connection_set_autoconnect_blocked_reason (NM_SETTINGS_CONNECTION (connection), reason);
nm_settings_connection_set_autoconnect_blocked_reason (connection, reason);
break;
default:
break;