... and add test cases for ct label.
Currently this dumped 'label 0x2', now 'label 1' would be shown.
This makes add/list behave the same.
Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
return;
}
/* can happen when connlabel.conf is altered after rules were added */
- gmp_printf("0x%Zx", expr->value);
+ printf("%ld\n", (long)mpz_scan1(expr->value, 0));
}
static struct error_record *ct_label_type_parse(const struct expr *sym,
ct original mark 42;fail
# swapped key and direction
ct mark original;fail
+
+ct label 127;ok
+ct label set 127;ok
+ct label 128;fail
[ bitwise reg 1 = (reg=1 & 0x00000020 ) ^ 0x00000000 ]
[ cmp neq reg 1 0x00000000 ]
+# ct label 127
+ip test-ip4 output
+ [ ct load label => reg 1 ]
+ [ bitwise reg 1 = (reg=1 & 0x00000000 0x00000000 0x00000000 0x80000000 ) ^ 0x00000000 0x00000000 0x00000000 0x00000000 ]
+ [ cmp neq reg 1 0x00000000 0x00000000 0x00000000 0x00000000 ]
+
+# ct label set 127
+ip test-ip4 output
+ [ immediate reg 1 0x00000000 0x00000000 0x00000000 0x80000000 ]
+ [ ct set label with reg 1 ]
+