Hello,

no need to check if unsigned value is smaller than zero. Please see the
attached patch.

Gmail likely mangles the inlined patch but here it goes:
--- brconfig.c.old    Wed Jan 13 16:35:39 2016
+++ brconfig.c    Wed Jan 13 16:36:26 2016
@@ -563,7 +563,7 @@ bridge_ifcost(const char *ifname, const char *val)
     errno = 0;
     v = strtoul(val, &endptr, 0);
     if (val[0] == '\0' || endptr[0] != '\0' ||
-        v < 0 || v > 0xffffffffUL ||
+        v > 0xffffffffUL ||
         (errno == ERANGE && v == ULONG_MAX))
         errx(1, "invalid arg for ifcost: %s", val);


--
Regards,
Ville Valkonen
--- brconfig.c.old	Wed Jan 13 16:35:39 2016
+++ brconfig.c	Wed Jan 13 16:36:26 2016
@@ -563,7 +563,7 @@ bridge_ifcost(const char *ifname, const char *val)
 	errno = 0;
 	v = strtoul(val, &endptr, 0);
 	if (val[0] == '\0' || endptr[0] != '\0' ||
-	    v < 0 || v > 0xffffffffUL ||
+	    v > 0xffffffffUL ||
 	    (errno == ERANGE && v == ULONG_MAX))
 		errx(1, "invalid arg for ifcost: %s", val);
 

Reply via email to