* [PATCH libnftnl 0/1] Bitwise dump format fix.
@ 2020-11-14 17:36 Jeremy Sowden
2020-11-14 17:36 ` [PATCH libnftnl 1/1] bitwise: improve formatting of registers in bitwise dumps Jeremy Sowden
0 siblings, 1 reply; 4+ messages in thread
From: Jeremy Sowden @ 2020-11-14 17:36 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: Netfilter Devel
The dumping of bitwise operations looks like:
[ bitwise reg 1 = (reg=1 & 0x0000ff0f ) ^ 0x00000000 ]
instead of:
[ bitwise reg 1 = ( reg 1 & 0x0000ff0f ) ^ 0x00000000 ]
which offends my sense of neatness. :) I have a follow-up patch to fix the
payloads of the nft Python tests that this change breaks. Are there other
things that might be affected?
Jeremy Sowden (1):
bitwise: improve formatting of registers in bitwise dumps.
src/expr/bitwise.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
2.29.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH libnftnl 1/1] bitwise: improve formatting of registers in bitwise dumps.
2020-11-14 17:36 [PATCH libnftnl 0/1] Bitwise dump format fix Jeremy Sowden
@ 2020-11-14 17:36 ` Jeremy Sowden
2020-11-15 11:16 ` Pablo Neira Ayuso
0 siblings, 1 reply; 4+ messages in thread
From: Jeremy Sowden @ 2020-11-14 17:36 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: Netfilter Devel
Registers are formatted as 'reg %u' everywhere apart from in bitwise
expressions where they are formatted as 'reg=%u'. Change bitwise to
match.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
src/expr/bitwise.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/expr/bitwise.c b/src/expr/bitwise.c
index 9ea2f662b3e6..ba379a84485e 100644
--- a/src/expr/bitwise.c
+++ b/src/expr/bitwise.c
@@ -215,7 +215,7 @@ nftnl_expr_bitwise_snprintf_bool(char *buf, size_t size,
{
int remain = size, offset = 0, ret;
- ret = snprintf(buf, remain, "reg %u = (reg=%u & ",
+ ret = snprintf(buf, remain, "reg %u = ( reg %u & ",
bitwise->dreg, bitwise->sreg);
SNPRINTF_BUFFER_SIZE(ret, remain, offset);
--
2.29.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH libnftnl 1/1] bitwise: improve formatting of registers in bitwise dumps.
2020-11-14 17:36 ` [PATCH libnftnl 1/1] bitwise: improve formatting of registers in bitwise dumps Jeremy Sowden
@ 2020-11-15 11:16 ` Pablo Neira Ayuso
2020-11-15 15:09 ` Jeremy Sowden
0 siblings, 1 reply; 4+ messages in thread
From: Pablo Neira Ayuso @ 2020-11-15 11:16 UTC (permalink / raw)
To: Jeremy Sowden; +Cc: Netfilter Devel
On Sat, Nov 14, 2020 at 05:36:05PM +0000, Jeremy Sowden wrote:
> Registers are formatted as 'reg %u' everywhere apart from in bitwise
> expressions where they are formatted as 'reg=%u'. Change bitwise to
> match.
LGTM.
But this also needs an update for the nftables tests too, right?
Thanks.
> Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
> ---
> src/expr/bitwise.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/expr/bitwise.c b/src/expr/bitwise.c
> index 9ea2f662b3e6..ba379a84485e 100644
> --- a/src/expr/bitwise.c
> +++ b/src/expr/bitwise.c
> @@ -215,7 +215,7 @@ nftnl_expr_bitwise_snprintf_bool(char *buf, size_t size,
> {
> int remain = size, offset = 0, ret;
>
> - ret = snprintf(buf, remain, "reg %u = (reg=%u & ",
> + ret = snprintf(buf, remain, "reg %u = ( reg %u & ",
> bitwise->dreg, bitwise->sreg);
> SNPRINTF_BUFFER_SIZE(ret, remain, offset);
>
> --
> 2.29.2
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH libnftnl 1/1] bitwise: improve formatting of registers in bitwise dumps.
2020-11-15 11:16 ` Pablo Neira Ayuso
@ 2020-11-15 15:09 ` Jeremy Sowden
0 siblings, 0 replies; 4+ messages in thread
From: Jeremy Sowden @ 2020-11-15 15:09 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: Netfilter Devel
[-- Attachment #1: Type: text/plain, Size: 1078 bytes --]
On 2020-11-15, at 12:16:54 +0100, Pablo Neira Ayuso wrote:
> On Sat, Nov 14, 2020 at 05:36:05PM +0000, Jeremy Sowden wrote:
> > Registers are formatted as 'reg %u' everywhere apart from in bitwise
> > expressions where they are formatted as 'reg=%u'. Change bitwise to
> > match.
>
> LGTM.
>
> But this also needs an update for the nftables tests too, right?
Yup, I'll send it now.
J.
> Thanks.
>
> > Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
> > ---
> > src/expr/bitwise.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/expr/bitwise.c b/src/expr/bitwise.c
> > index 9ea2f662b3e6..ba379a84485e 100644
> > --- a/src/expr/bitwise.c
> > +++ b/src/expr/bitwise.c
> > @@ -215,7 +215,7 @@ nftnl_expr_bitwise_snprintf_bool(char *buf, size_t size,
> > {
> > int remain = size, offset = 0, ret;
> >
> > - ret = snprintf(buf, remain, "reg %u = (reg=%u & ",
> > + ret = snprintf(buf, remain, "reg %u = ( reg %u & ",
> > bitwise->dreg, bitwise->sreg);
> > SNPRINTF_BUFFER_SIZE(ret, remain, offset);
> >
> > --
> > 2.29.2
> >
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-11-15 15:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-14 17:36 [PATCH libnftnl 0/1] Bitwise dump format fix Jeremy Sowden
2020-11-14 17:36 ` [PATCH libnftnl 1/1] bitwise: improve formatting of registers in bitwise dumps Jeremy Sowden
2020-11-15 11:16 ` Pablo Neira Ayuso
2020-11-15 15:09 ` Jeremy Sowden
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).