system-linux: remove redundant check for strtoul() return value
[project/netifd.git] / system-linux.c
index 471efff..ddc31d8 100644 (file)
@@ -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;