From 5ca72c78a0ae3ff818c7d47de2738fe776e0c470 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 2 May 2010 00:44:44 -0700 Subject: [PATCH] ip6: avoid autoconf routes where dest == gateway These return errors when we try to add them via netlink (both internal code and using /sbin/ip) so we'll ignore them for now. --- src/ip6-manager/nm-ip6-manager.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ip6-manager/nm-ip6-manager.c b/src/ip6-manager/nm-ip6-manager.c index 0b7949d974..cafe9cc430 100644 --- a/src/ip6-manager/nm-ip6-manager.c +++ b/src/ip6-manager/nm-ip6-manager.c @@ -983,6 +983,13 @@ nm_ip6_manager_get_ip6_config (NMIP6Manager *manager, int ifindex) continue; } + /* Also ignore routes where the destination and gateway are the same, + * which apparently get added by the kernel but return -EINVAL when + * we try to add them via netlink. + */ + if (gateway && !memcmp (dest, gateway, sizeof (struct in6_addr))) + continue; + ip6route = nm_ip6_route_new (); nm_ip6_route_set_dest (ip6route, dest); nm_ip6_route_set_prefix (ip6route, rtnl_route_get_dst_len (rtnlroute));