From d6f6ccef432fb45a30b0b642975acd36d08410fb Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 4 Mar 2014 14:34:12 +0100 Subject: [PATCH] core: fix adding gateway route for IPv6 Setting the address flag IFA_F_NOPREFIXROUTE broke adding the device route to the IPv6 prefix because the check for nm_ip6_config_destination_is_direct() caused the route to be skipped. This, together with the kernel no longer adding the prefix route resulted in no device route for autoconf /64 prefixes. https://bugzilla.redhat.com/show_bug.cgi?id=1068632 https://bugzilla.redhat.com/show_bug.cgi?id=1072410 Signed-off-by: Thomas Haller --- src/devices/nm-device.c | 9 +++++---- src/nm-ip6-config.c | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 02ce08ff2e..2ff4ab6a08 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -3332,13 +3332,14 @@ rdisc_config_changed (NMRDisc *rdisc, NMRDiscConfigMap changed, NMDevice *device nm_platform_check_support_kernel_extended_ifa_flags (); } - /* without system_support, these flags will be ignored. - * Still, we set them (why not?). - **/ - ifa_flags = IFA_F_NOPREFIXROUTE; + if (system_support) + ifa_flags = IFA_F_NOPREFIXROUTE; if (priv->rdisc_use_tempaddr == NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR || priv->rdisc_use_tempaddr == NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_PUBLIC_ADDR) + { + /* without system_support, this flag will be ignored. Still set it, doesn't seem to do any harm. */ ifa_flags |= IFA_F_MANAGETEMPADDR; + } g_return_if_fail (priv->act_request); connection = nm_device_get_connection (device); diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c index 7de01ece42..8ca7c0cd05 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.c @@ -513,7 +513,8 @@ nm_ip6_config_destination_is_direct (const NMIP6Config *config, const struct in6 for (i = 0; i < num; i++) { const NMPlatformIP6Address *item = nm_ip6_config_get_address (config, i); - if (item->plen <= plen && same_prefix (&item->address, network, item->plen)) + if (item->plen <= plen && same_prefix (&item->address, network, item->plen) && + !(item->flags & IFA_F_NOPREFIXROUTE)) return TRUE; }