* [PATCH nft] ct: direction should be integer, not bitmask
@ 2014-02-17 21:05 Florian Westphal
2014-02-17 23:09 ` Pablo Neira Ayuso
2014-02-18 1:28 ` Patrick McHardy
0 siblings, 2 replies; 3+ messages in thread
From: Florian Westphal @ 2014-02-17 21:05 UTC (permalink / raw)
To: netfilter-devel; +Cc: Florian Westphal
should always generate cmp op (its enum 0, 1 in kernel).
Note: 'original,reply' will no longer work after this patch.
Signed-off-by: Florian Westphal <fw@strlen.de>
---
src/ct.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/ct.c b/src/ct.c
index f893df9..79d4666 100644
--- a/src/ct.c
+++ b/src/ct.c
@@ -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,
};
--
1.8.1.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH nft] ct: direction should be integer, not bitmask
2014-02-17 21:05 [PATCH nft] ct: direction should be integer, not bitmask Florian Westphal
@ 2014-02-17 23:09 ` Pablo Neira Ayuso
2014-02-18 1:28 ` Patrick McHardy
1 sibling, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2014-02-17 23:09 UTC (permalink / raw)
To: Florian Westphal; +Cc: netfilter-devel
On Mon, Feb 17, 2014 at 10:05:07PM +0100, Florian Westphal wrote:
> 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!
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH nft] ct: direction should be integer, not bitmask
2014-02-17 21:05 [PATCH nft] ct: direction should be integer, not bitmask Florian Westphal
2014-02-17 23:09 ` Pablo Neira Ayuso
@ 2014-02-18 1:28 ` Patrick McHardy
1 sibling, 0 replies; 3+ messages in thread
From: Patrick McHardy @ 2014-02-18 1:28 UTC (permalink / raw)
To: Florian Westphal; +Cc: netfilter-devel
On Mon, Feb 17, 2014 at 10:05:07PM +0100, Florian Westphal wrote:
> should always generate cmp op (its enum 0, 1 in kernel).
>
> Note: 'original,reply' will no longer work after this patch.
I agree.
>
> Signed-off-by: Florian Westphal <fw@strlen.de>
> ---
> src/ct.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/ct.c b/src/ct.c
> index f893df9..79d4666 100644
> --- a/src/ct.c
> +++ b/src/ct.c
> @@ -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,
> };
>
> --
> 1.8.1.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-02-18 1:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-17 21:05 [PATCH nft] ct: direction should be integer, not bitmask Florian Westphal
2014-02-17 23:09 ` Pablo Neira Ayuso
2014-02-18 1:28 ` Patrick McHardy
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.