it exists on a different metric than the default.
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
#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);
}