]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libxt_TOS: make sure --set-tos value/mask is recognized
authorJan Engelhardt <jengelh@medozas.de>
Mon, 30 Jun 2008 12:57:08 +0000 (14:57 +0200)
committerPatrick McHardy <kaber@trash.net>
Mon, 30 Jun 2008 12:57:08 +0000 (14:57 +0200)
Only when a 'stop' pointer is passed, the string may consist of more
than just a number.

Reported-by: Anonymous
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
extensions/tos_values.c

index 1630834e6df3824c9a4c3797795cf285ec767aa4..4c0b0bcb1ebd521855ad1c8018e524bd5bfab03c 100644 (file)
@@ -56,8 +56,9 @@ static bool tos_parse_symbolic(const char *str, struct tos_value_mask *tvm,
 {
        const unsigned int max = 255;
        const struct tos_symbol_info *symbol;
+       char *tmp;
 
-       if (strtonum(str, NULL, NULL, 0, max))
+       if (strtonum(str, &tmp, NULL, 0, max))
                return tos_parse_numeric(str, tvm, max);
 
        /* Do not consider ECN bits */