summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-01-12 10:09:52 +0100
committerThomas Haller <thaller@redhat.com>2018-02-21 20:28:46 +0100
commit0ef23b139d95d455343ad1ca19c984c98dd7dc39 (patch)
treeee6b2faf7180e6c2a781cf295ee6ca889363d893
parentbfe38c1bf348ea459e5efac9af1c80c052c58ccd (diff)
downloadNetworkManager-0ef23b139d95d455343ad1ca19c984c98dd7dc39.tar.gz
device: don't set NMDeviceModem's ip-iface right after constuction
nm_device_modem_new() is only called with a newly created NMModemBroadband or NMModemOfono instance. See the callers - NMModemManager:handle_new_modem() - NMWwanFactory:modem_added_cb() - NMDeviceModem:nm_device_modem_new() Hence, at that point, the modem cannot yet have a data-port or ip-iface set, because that is only obtained later.
-rw-r--r--src/devices/wwan/nm-device-modem.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c
index 1ef385d49e..86f1864946 100644
--- a/src/devices/wwan/nm-device-modem.c
+++ b/src/devices/wwan/nm-device-modem.c
@@ -702,17 +702,15 @@ nm_device_modem_init (NMDeviceModem *self)
NMDevice *
nm_device_modem_new (NMModem *modem)
{
- NMDevice *self;
NMDeviceModemCapabilities caps = NM_DEVICE_MODEM_CAPABILITY_NONE;
NMDeviceModemCapabilities current_caps = NM_DEVICE_MODEM_CAPABILITY_NONE;
- const char *data_port;
g_return_val_if_fail (NM_IS_MODEM (modem), NULL);
/* Load capabilities */
nm_modem_get_capabilities (modem, &caps, &current_caps);
- self = g_object_new (NM_TYPE_DEVICE_MODEM,
+ return g_object_new (NM_TYPE_DEVICE_MODEM,
NM_DEVICE_UDI, nm_modem_get_path (modem),
NM_DEVICE_IFACE, nm_modem_get_uid (modem),
NM_DEVICE_DRIVER, nm_modem_get_driver (modem),
@@ -723,15 +721,6 @@ nm_device_modem_new (NMModem *modem)
NM_DEVICE_MODEM_CAPABILITIES, caps,
NM_DEVICE_MODEM_CURRENT_CAPABILITIES, current_caps,
NULL);
-
- /* If the data port is known, set it as the IP interface immediately */
- data_port = nm_modem_get_data_port (modem);
- if (data_port) {
- nm_device_set_ip_iface (self, data_port);
- nm_device_ipv6_sysctl_set (self, "disable_ipv6", "1");
- }
-
- return self;
}
static void