From 17b49b957cb3d92a86ccdce0559e6b753bd7aa98 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 4 May 2010 20:24:17 -0700 Subject: [PATCH] ip6: don't flush link-local IPv6 routes (rh #587836) Since a link-local address should pretty much always be assigned to an active interface, avoid flushing the routes that allow link-local communication to work. --- src/nm-system.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/nm-system.c b/src/nm-system.c index 32be53ff3..35aa36a11 100644 --- a/src/nm-system.c +++ b/src/nm-system.c @@ -1203,6 +1203,25 @@ check_one_route (struct nl_object *object, void *user_data) if (data->family && rtnl_route_get_family (route) != data->family) return; + /* We don't want to flush IPv6 link-local routes that may exist on the + * the interface since the LL address and routes should normally stay + * assigned all the time. + */ + if ( (data->family == AF_INET6 || data->family == AF_UNSPEC) + && (rtnl_route_get_family (route) == AF_INET6)) { + struct nl_addr *nl; + struct in6_addr *addr = NULL; + + nl = rtnl_route_get_dst (route); + if (nl) + addr = nl_addr_get_binary_addr (nl); + + if (addr) { + if (IN6_IS_ADDR_LINKLOCAL (addr) || IN6_IS_ADDR_MC_LINKLOCAL (addr)) + return; + } + } + err = rtnl_route_del (nm_netlink_get_default_handle (), route, 0); if (err < 0) { nm_log_err (LOGD_DEVICE,