summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2017-03-21 15:38:27 -0500
committerDan Williams <dcbw@redhat.com>2017-03-22 08:26:28 -0500
commitfcba6a28819b5a93b4762ea32ff7bffd18504f1a (patch)
treec62cec5b2a93bc6d356229e4c964969403d02139
parentaab4e2fdaa46da0340572049504915e0f5d2c206 (diff)
downloadNetworkManager-fcba6a28819b5a93b4762ea32ff7bffd18504f1a.tar.gz
ppp: only request IPV6CP when IPv6 is enabled in the connection
NM always asks pppd to run IPV6CP which will complete if the modem supports IPv6. If the user doesn't want IPv6 then NM just ignores the result. But if the host has disabled IPv6, then pppd will fail to complete the connection because pppd tries to assign the Link-Local address to the pppX interface, and if IPv6 is disabled that fails and terminates the PPP session. So only request IPV6CP when the user wants IPv6 on the connection; if they have disabled IPv6 on their host then they can simply set ipv6.method=ignore. https://mail.gnome.org/archives/networkmanager-list/2017-March/msg00047.html (cherry picked from commit 8d4570d28d1825d52de936b21d785c75b602394a)
-rw-r--r--src/ppp-manager/nm-ppp-manager.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/ppp-manager/nm-ppp-manager.c b/src/ppp-manager/nm-ppp-manager.c
index 34c550fa12..c9d16ddcfe 100644
--- a/src/ppp-manager/nm-ppp-manager.c
+++ b/src/ppp-manager/nm-ppp-manager.c
@@ -835,6 +835,7 @@ create_pppd_cmd_line (NMPPPManager *self,
NMSettingAdsl *adsl,
const char *ppp_name,
guint baud_override,
+ gboolean ip6_enabled,
GError **err)
{
NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (self);
@@ -858,9 +859,11 @@ create_pppd_cmd_line (NMPPPManager *self,
/* NM handles setting the default route */
nm_cmd_line_add_string (cmd, "nodefaultroute");
- /* Allow IPv6 to be configured by IPV6CP */
- nm_cmd_line_add_string (cmd, "ipv6");
- nm_cmd_line_add_string (cmd, ",");
+ if (ip6_enabled) {
+ /* Allow IPv6 to be configured by IPV6CP */
+ nm_cmd_line_add_string (cmd, "ipv6");
+ nm_cmd_line_add_string (cmd, ",");
+ }
ppp_debug = !!getenv ("NM_PPP_DEBUG");
if (nm_logging_enabled (LOGL_DEBUG, LOGD_PPP))
@@ -1038,6 +1041,8 @@ nm_ppp_manager_start (NMPPPManager *manager,
NMCmdLine *ppp_cmd;
char *cmd_str;
struct stat st;
+ const char *ip6_method;
+ gboolean ip6_enabled = FALSE;
g_return_val_if_fail (NM_IS_PPP_MANAGER (manager), FALSE);
g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE);
@@ -1080,7 +1085,10 @@ nm_ppp_manager_start (NMPPPManager *manager,
adsl_setting = (NMSettingAdsl *) nm_connection_get_setting (connection, NM_TYPE_SETTING_ADSL);
- ppp_cmd = create_pppd_cmd_line (manager, s_ppp, pppoe_setting, adsl_setting, ppp_name, baud_override, err);
+ ip6_method = nm_utils_get_ip_config_method (connection, NM_TYPE_SETTING_IP6_CONFIG);
+ ip6_enabled = g_strcmp0 (ip6_method, NM_SETTING_IP6_CONFIG_METHOD_AUTO) == 0;
+
+ ppp_cmd = create_pppd_cmd_line (manager, s_ppp, pppoe_setting, adsl_setting, ppp_name, baud_override, ip6_enabled, err);
if (!ppp_cmd)
goto out;