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 <thaller@redhat.com>
This commit is contained in:
Thomas Haller 2014-03-04 14:34:12 +01:00
parent 8cd0de231a
commit d6f6ccef43
2 changed files with 7 additions and 5 deletions

View file

@ -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);

View file

@ -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;
}