X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=system-linux.c;h=ddc31d82ed182019af6b8b73959957a0874307ab;hp=471efffcd2876d5da733c44981240e67cd8527d0;hb=a063705a03a6c5a41b5f7aed251bfb3ba5c844c3;hpb=b4f89847883de95126ef332aa8df886c64b16b3d diff --git a/system-linux.c b/system-linux.c index 471efff..ddc31d8 100644 --- a/system-linux.c +++ b/system-linux.c @@ -1896,7 +1896,8 @@ static int system_rt(struct device *dev, struct device_route *route, int cmd) rtm.rtm_type == RTN_ANYCAST) { rtm.rtm_scope = RT_SCOPE_LINK; } else if (rtm.rtm_type == RTN_BLACKHOLE || rtm.rtm_type == RTN_UNREACHABLE || - rtm.rtm_type == RTN_PROHIBIT || rtm.rtm_type == RTN_FAILED_POLICY) { + rtm.rtm_type == RTN_PROHIBIT || rtm.rtm_type == RTN_FAILED_POLICY || + rtm.rtm_type == RTN_THROW) { rtm.rtm_scope = RT_SCOPE_UNIVERSE; dev = NULL; } @@ -1987,8 +1988,8 @@ bool system_resolve_rt_proto(const char *type, unsigned int *id) FILE *f; char *e, buf[128]; unsigned int n, proto = 256; - - if ((n = strtoul(type, &e, 0)) >= 0 && !*e && e != type) + n = strtoul(type, &e, 0); + if (!*e && e != type) proto = n; else if (!strcmp(type, "unspec")) proto = RTPROT_UNSPEC;