From 267948f2b7f677f9dd8ced5f5f6755c6694cfcab Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Mon, 11 Jun 2018 12:58:15 +0200 Subject: [PATCH 1/2] wwan: set the route parameters at the beginning of ip4 config We set the metric to the routes as we receive them from the PPP plugin. We ought to let the modem know before it starts IPv4 configuration, not right before the commit. https://bugzilla.redhat.com/show_bug.cgi?id=1585611 --- src/devices/wwan/nm-modem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/devices/wwan/nm-modem.c b/src/devices/wwan/nm-modem.c index fbe99cc30e..d018b4e5fe 100644 --- a/src/devices/wwan/nm-modem.c +++ b/src/devices/wwan/nm-modem.c @@ -704,6 +704,8 @@ nm_modem_stage3_ip4_config_start (NMModem *self, connection = nm_act_request_get_applied_connection (req); g_return_val_if_fail (connection, NM_ACT_STAGE_RETURN_FAILURE); + nm_modem_set_route_parameters_from_device (self, device); + method = nm_utils_get_ip_config_method (connection, NM_TYPE_SETTING_IP4_CONFIG); /* Only Disabled and Auto methods make sense for WWAN */ @@ -745,8 +747,6 @@ nm_modem_ip4_pre_commit (NMModem *modem, { NMModemPrivate *priv = NM_MODEM_GET_PRIVATE (modem); - nm_modem_set_route_parameters_from_device (modem, device); - /* If the modem has an ethernet-type data interface (ie, not PPP and thus * not point-to-point) and IP config has a /32 prefix, then we assume that * ARP will be pointless and we turn it off. From 650b5fd99e31f9fed74f0600f9613883d3c547ed Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Mon, 11 Jun 2018 12:58:21 +0200 Subject: [PATCH 2/2] wwan: ensure the route parameters are set on IPv6 only configuration --- src/devices/bluetooth/nm-device-bt.c | 7 ++----- src/devices/wwan/nm-device-modem.c | 2 +- src/devices/wwan/nm-modem.c | 9 +++++++-- src/devices/wwan/nm-modem.h | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/devices/bluetooth/nm-device-bt.c b/src/devices/bluetooth/nm-device-bt.c index 1d237d9277..92ad0b31cc 100644 --- a/src/devices/bluetooth/nm-device-bt.c +++ b/src/devices/bluetooth/nm-device-bt.c @@ -903,11 +903,8 @@ act_stage3_ip6_config_start (NMDevice *device, { NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE ((NMDeviceBt *) device); - if (priv->bt_type == NM_BT_CAPABILITY_DUN) { - return nm_modem_stage3_ip6_config_start (priv->modem, - nm_device_get_act_request (device), - out_failure_reason); - } + if (priv->bt_type == NM_BT_CAPABILITY_DUN) + return nm_modem_stage3_ip6_config_start (priv->modem, device, out_failure_reason); return NM_DEVICE_CLASS (nm_device_bt_parent_class)->act_stage3_ip6_config_start (device, out_config, out_failure_reason); } diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c index 2a3e9ebeb7..352b1c3e8b 100644 --- a/src/devices/wwan/nm-device-modem.c +++ b/src/devices/wwan/nm-device-modem.c @@ -542,7 +542,7 @@ act_stage3_ip6_config_start (NMDevice *device, NMDeviceStateReason *out_failure_reason) { return nm_modem_stage3_ip6_config_start (NM_DEVICE_MODEM_GET_PRIVATE ((NMDeviceModem *) device)->modem, - nm_device_get_act_request (device), + device, out_failure_reason); } diff --git a/src/devices/wwan/nm-modem.c b/src/devices/wwan/nm-modem.c index d018b4e5fe..ff1579d102 100644 --- a/src/devices/wwan/nm-modem.c +++ b/src/devices/wwan/nm-modem.c @@ -804,20 +804,25 @@ stage3_ip6_config_request (NMModem *self, NMDeviceStateReason *out_failure_reaso NMActStageReturn nm_modem_stage3_ip6_config_start (NMModem *self, - NMActRequest *req, + NMDevice *device, NMDeviceStateReason *out_failure_reason) { NMModemPrivate *priv; + NMActRequest *req; NMActStageReturn ret; NMConnection *connection; const char *method; g_return_val_if_fail (NM_IS_MODEM (self), NM_ACT_STAGE_RETURN_FAILURE); - g_return_val_if_fail (NM_IS_ACT_REQUEST (req), NM_ACT_STAGE_RETURN_FAILURE); + + req = nm_device_get_act_request (device); + g_return_val_if_fail (req, NM_ACT_STAGE_RETURN_FAILURE); connection = nm_act_request_get_applied_connection (req); g_return_val_if_fail (connection, NM_ACT_STAGE_RETURN_FAILURE); + nm_modem_set_route_parameters_from_device (self, device); + method = nm_utils_get_ip_config_method (connection, NM_TYPE_SETTING_IP6_CONFIG); /* Only Ignore and Auto methods make sense for WWAN */ diff --git a/src/devices/wwan/nm-modem.h b/src/devices/wwan/nm-modem.h index 3e281c0c92..6e78d2d5d7 100644 --- a/src/devices/wwan/nm-modem.h +++ b/src/devices/wwan/nm-modem.h @@ -221,7 +221,7 @@ NMActStageReturn nm_modem_stage3_ip4_config_start (NMModem *modem, NMDeviceStateReason *out_failure_reason); NMActStageReturn nm_modem_stage3_ip6_config_start (NMModem *modem, - NMActRequest *req, + NMDevice *device, NMDeviceStateReason *out_failure_reason); void nm_modem_ip4_pre_commit (NMModem *modem, NMDevice *device, NMIP4Config *config);