ip6: avoid autoconf routes where dest == gateway
authorDan Williams <dcbw@redhat.com>
Sun, 2 May 2010 07:44:44 +0000 (00:44 -0700)
committerDan Williams <dcbw@redhat.com>
Sun, 2 May 2010 07:44:44 +0000 (00:44 -0700)
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

index 0b7949d..cafe9cc 100644 (file)
@@ -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));