With net.ipv4.conf.XXX.ignore_routes_with_linkdown sysctl, a user can
ensure the kernel does not use a route whose target interface is down.
Such route is marked with a 'dead' / RTNH_F_DEAD flag.
Ignore these routes or multipath nexthops during scan.
Thanks to Vincent Bernat for the original patch.
if ((len < sizeof(*nh)) || (len < nh->rtnh_len))
return NULL;
+ if (nh->rtnh_flags & RTNH_F_DEAD)
+ goto next;
+
*last = rv = lp_allocz(s->pool, NEXTHOP_MAX_SIZE);
last = &(rv->next);
}
#endif
-
+ next:
len -= NLMSG_ALIGN(nh->rtnh_len);
nh = RTNH_NEXT(nh);
}
break;
}
+ if (i->rtm_flags & RTNH_F_DEAD)
+ return;
+
ra->nh.iface = if_find_by_index(oif);
if (!ra->nh.iface)
{