summaryrefslogtreecommitdiffstats
path: root/tc
diff options
context:
space:
mode:
authorosdl.net!shemminger <osdl.net!shemminger>2005-02-07 18:16:29 +0000
committerosdl.net!shemminger <osdl.net!shemminger>2005-02-07 18:16:29 +0000
commita8b303cc3f5a867539cec4215f856de4f69606a6 (patch)
tree74707a766a228906116f4bea0d76370562aaa795 /tc
parent2f3c04227ee5cc4bb5249d0b96247adc24b9b37c (diff)
validate classid
(Logical change 1.137)
Diffstat (limited to 'tc')
-rw-r--r--tc/tc_util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tc/tc_util.c b/tc/tc_util.c
index 0dc76c03..a6413e66 100644
--- a/tc/tc_util.c
+++ b/tc/tc_util.c
@@ -61,11 +61,15 @@ int get_tc_classid(__u32 *h, const char *str)
return -1;
}
if (*p == ':') {
+ if (maj >= (1<<16))
+ return -1;
maj <<= 16;
str = p+1;
min = strtoul(str, &p, 16);
if (*p != 0)
return -1;
+ if (min >= (1<<16))
+ return -1;
maj |= min;
} else if (*p != 0)
return -1;