]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc_util: Fix no error return when large parent id used
authorLai Peter Jun Ann <jun.ann.lai@intel.com>
Thu, 17 Nov 2022 05:33:17 +0000 (13:33 +0800)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 23 Nov 2022 16:54:37 +0000 (08:54 -0800)
This patch is to fix the issue where there is no error return
when large value of parent ID is being used. The return value by
stroul() is unsigned long int. Hence the datatype for maj and min
should defined as unsigned long to avoid overflow issue.

Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
Signed-off-by: Lai Peter Jun Ann <jun.ann.lai@intel.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
tc/tc_util.c

index 44137adbf65305e4465b549093c9e2194250a918..334334db6cd40bc78f340c84ef99016ed4f9c923 100644 (file)
@@ -93,7 +93,7 @@ ok:
 
 int get_tc_classid(__u32 *h, const char *str)
 {
-       __u32 maj, min;
+       unsigned long maj, min;
        char *p;
 
        maj = TC_H_ROOT;