]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
long/ulong iproute-git fix
authorDenys Fedoryshchenko <denys@visp.net.lb>
Wed, 30 Jul 2008 14:34:07 +0000 (17:34 +0300)
committerStephen Hemminger <stephen.hemminger@vyatta.com>
Thu, 31 Jul 2008 22:25:15 +0000 (15:25 -0700)
This patch fixes bug in Metadata ematch attributes parser

strtoul on error return ULONG_MAX, not LONG_MAX

Patch attached as file

tc/em_meta.c

index f12be7faa81e54f57e0e3fca1db166370782c7b4..ee6034fb6f410e02efd8660cea5fe8aa9986e314 100644 (file)
@@ -262,7 +262,7 @@ parse_object(struct bstr *args, struct bstr *arg, struct tcf_meta_val *obj,
        }
 
        num = bstrtoul(arg);
-       if (num != LONG_MAX) {
+       if (num != ULONG_MAX) {
                obj->kind = TCF_META_TYPE_INT << 12;
                obj->kind |= TCF_META_ID_VALUE;
                *dst = (unsigned long) num;
@@ -320,7 +320,7 @@ compatible:
                        a = bstr_next(a);
 
                        shift = bstrtoul(a);
-                       if (shift == LONG_MAX) {
+                       if (shift == ULONG_MAX) {
                                PARSE_ERR(a, "meta: invalid shift, must " \
                                    "be numeric");
                                return PARSE_FAILURE;
@@ -338,7 +338,7 @@ compatible:
                        a = bstr_next(a);
 
                        mask = bstrtoul(a);
-                       if (mask == LONG_MAX) {
+                       if (mask == ULONG_MAX) {
                                PARSE_ERR(a, "meta: invalid mask, must be " \
                                    "numeric");
                                return PARSE_FAILURE;