]> granicus.if.org Git - ipset/commitdiff
ICMP/ICMPv6 type/code parser bug fixed
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Wed, 16 Nov 2011 21:49:01 +0000 (22:49 +0100)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Wed, 16 Nov 2011 21:49:01 +0000 (22:49 +0100)
The ICMP/ICMPv6 type/code parser swapped the type and code values.
(Bug reported by Sabitov)

lib/parse.c

index 3ca702cdeeadcf74f3d911e6388f8bdbd28d79a6..eeb253c7221b01d3c3b94bdfe373d068c34da0d5 100644 (file)
@@ -391,8 +391,8 @@ parse_icmp_typecode(struct ipset_session *session,
                                 str, family);
        }
        *a++ = '\0';
-       if ((err = string_to_u8(session, a, &type)) != 0 ||
-           (err = string_to_u8(session, tmp, &code)) != 0)
+       if ((err = string_to_u8(session, tmp, &type)) != 0 ||
+           (err = string_to_u8(session, a, &code)) != 0)
                goto error;
 
        typecode = (type << 8) | code;