ct: direction should be integer, not bitmask
Florian Westphal
maintainerPATCH 1/1 ct: direction should be integer, not bitmask
should always generate cmp op (its enum 0, 1 in kernel).
Note: 'original,reply' will no longer work after this patch.
--- src/ct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/ct.c +1 -1
@@ -61,7 +61,7 @@ static const struct datatype ct_dir_type = { .desc = "conntrack direction", .byteorder = BYTEORDER_INVALID, .size = BITS_PER_BYTE, - .basetype = &bitmask_type, + .basetype = &integer_type, .sym_tbl = &ct_dir_tbl, };
Signature · 1 line
1.8.1.5
Quoted 3 lines · Florian Westphal
should always generate cmp op (its enum 0, 1 in kernel).
Note: 'original,reply' will no longer work after this patch.
This is also fixing the bytecode that is generated for:
nft add rule ip filter output ct direction reply counter
ip filter output 54 53
[ ct load direction => reg 1 ]
[ bitwise reg 1 = (reg=1 & 0x00000001 ) ^ 0x00000000 ] [ cmp neq reg 1 0x00000000 ]
[ counter pkts 0 bytes 0 ]
and the output:
ct direction & reply != original counter packets 0 bytes 0
which doesn't obviously work.
To this:
ip filter output 57 56
[ ct load direction => reg 1 ]
[ cmp eq reg 1 0x00000001 ]
[ counter pkts 0 bytes 0 ]
Feel free to push it. Thanks!
Quoted 3 lines · Florian Westphal
should always generate cmp op (its enum 0, 1 in kernel).
Note: 'original,reply' will no longer work after this patch.
I agree.
Quoted 26 lines
Signed-off-by Florian Westphal <[email protected]>--- src/ct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)src/ct.c +1
-1@@ -61,7 +61,7 @@ static const struct datatype ct_dir_type = { .desc = "conntrack direction", .byteorder = BYTEORDER_INVALID, .size = BITS_PER_BYTE, - .basetype = &bitmask_type, + .basetype = &integer_type, .sym_tbl = &ct_dir_tbl, };Signature · 6 lines
1.8.1.5 -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html