From: Roy Marples Date: Tue, 7 Aug 2012 07:03:13 +0000 (+0000) Subject: For some reason, Linux likes to re-add the IPv6 network route even if X-Git-Tag: v5.6.2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc6c8ec865a1688ac56016a13c75730fd824bce8;p=thirdparty%2Fdhcpcd.git For some reason, Linux likes to re-add the IPv6 network route even if it exists on a different metric than the default. --- diff --git a/ipv6.c b/ipv6.c index 8a0ae048..f542d54a 100644 --- a/ipv6.c +++ b/ipv6.c @@ -327,6 +327,9 @@ int ipv6_remove_subnet(struct ra *rap, struct ipv6_addr *addr) { struct rt6 *rt; +#if HAVE_ROUTE_METRIC + struct rt6 *ort; +#endif int r; /* We need to delete the subnet route to have our metric or @@ -340,7 +343,15 @@ ipv6_remove_subnet(struct ra *rap, struct ipv6_addr *addr) #else rt->metric = 0; #endif +#if HAVE_ROUTE_METRIC + /* For some reason, Linux likes to re-add the subnet + route under the original metric. + I would love to find a way of stopping this! */ + if ((ort = find_route6(routes, rt)) == NULL || + ort->metric != rt->metric) +#else if (!find_route6(routes, rt)) +#endif r = del_route6(rt); free(rt); }