From 2e0ba9d865dd386ba719f7aaaf72c101c4eb7bfa Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 23 Jul 2014 14:07:33 -0500 Subject: [PATCH] wwan: use a shorter DHCP timeout With WWAN, the DHCP is all done in modem firmware, and never started until we know we have a successful packet connection to the network. Which means the modem firmware already knows the IP details and is ready to provide them. Furthermore, since the DHCP is done on what is essentially a reliable, wired point-to-point link, we don't have to waste time with retransmits for dropped packets either. --- src/devices/wwan/nm-device-modem.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c index cc08d176d7..fd1b7f2868 100644 --- a/src/devices/wwan/nm-device-modem.c +++ b/src/devices/wwan/nm-device-modem.c @@ -591,6 +591,18 @@ nm_device_modem_init (NMDeviceModem *self) { } +static void +constructed (GObject *object) +{ + G_OBJECT_CLASS (nm_device_modem_parent_class)->constructed (object); + + /* DHCP is always done by the modem firmware, not by the network, and + * by the time we get around to DHCP the firmware should already know + * the IP addressing details. So the DHCP timeout can be much shorter. + */ + nm_device_set_dhcp_timeout (NM_DEVICE (object), 15); +} + static void set_modem (NMDeviceModem *self, NMModem *modem) { @@ -684,6 +696,7 @@ nm_device_modem_class_init (NMDeviceModemClass *mclass) object_class->dispose = dispose; object_class->get_property = get_property; object_class->set_property = set_property; + object_class->constructed = constructed; device_class->check_connection_compatible = check_connection_compatible; device_class->check_connection_available = check_connection_available;