From 45434c0f2a8a5f71c2aca9f91df139eaeee1b3c1 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 19 Dec 2014 10:45:31 -0600 Subject: [PATCH] core: force disable_ipv6=0 when turning on userspace IPv6LL If a device assumes a connection without activating a user-requested or NM-requested connection, then disable_ipv6 is not touched. When the device is deactivated, it still isn't touched even though userspace IPv6LL is enabled. This could lead to an user-requested activation with IPv6 configuration, but disable_ipv6=1. Whenever userspace IPv6LL is turned on, we should also set disable_ipv6=0 to ensure IPv6 can function. Userspace IPv6LL will ensure that the interface does not have an address until the user/connection requests it, which was the only reason that NM touched disable_ipv6 anyway. fixes:NetworkManager_Test203_testcase_286589 fixes:NetworkManager_Test204_testcase_286590 --- src/devices/nm-device.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index a9899535df..119d4a85c1 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -4345,11 +4345,12 @@ set_nm_ipv6ll (NMDevice *self, gboolean enable) if (enable) { /* Bounce IPv6 to ensure the kernel stops IPv6LL address generation */ value = nm_platform_sysctl_get (nm_utils_ip6_property_path (iface, "disable_ipv6")); - if (g_strcmp0 (value, "0") == 0) { + if (g_strcmp0 (value, "0") == 0) nm_device_ipv6_sysctl_set (self, "disable_ipv6", "1"); - nm_device_ipv6_sysctl_set (self, "disable_ipv6", "0"); - } g_free (value); + + /* Ensure IPv6 is enabled */ + nm_device_ipv6_sysctl_set (self, "disable_ipv6", "0"); } }