All of lore.kernel.org
 help / color / mirror / Atom feed
* Reversed byte order issue with nft ?
@ 2014-12-03 17:20 leroy christophe
  2014-12-04 13:27 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 3+ messages in thread
From: leroy christophe @ 2014-12-03 17:20 UTC (permalink / raw)
  To: Pablo Neira Ayuso, netfilter, netfilter-devel

Hi,

When doing 'nft list ruleset', I get a bad result (see below), fields 
appear as "unknown" and/or as numeric values.

Running 'nft' with gdb, it looks like something is wrong with byte ordering:

In function symbolic_constant_print(), mpz_export_data() return a 
strange val.
First time we go there, we get 0x800000000
Next time, we get 0x400000000
Last time, we get 0x200000000
While we expect 8(new), 4(related), 2(established)

Any idea on what to do ?

Target is a powerpc (big endian), everything is cross-compiled using GNU 
tools on x86 (little endian)

kernel 3.18-rc7
nftables-20141121
libnftnl-20141121
gmp-4.3.2
libmnl-1.0.3
libnfnetlink-1.0.1
libnetfilter_conntrack-1.0.4

Thanks
Christophe

# uname -a
Linux vgoip 3.18.0-rc7-local-dirty #94 PREEMPT Wed Dec 3 17:25:41 CET 
2014 ppc GNU/Linux
# nft -f /etc/nftables.conf
# nft list ruleset
table ip filter {
         chain input {
                  type filter hook input priority 0;
                  oifname "lo" accept
                  ct state { 4, 2} accept
                  ct state 8 unknown unknown 0x16 [invalid type] accept
                  ip protocol icmp accept
         }

         chain forward {
                  type filter hook forward priority 0;
                  drop
         }
}

# cat /etc/nftables.conf
flush ruleset
table ip filter {
         chain input {
                  type filter hook input priority 0;
                  oifname "lo" accept
                  ct state { established, related} accept
                  ct state new tcp dport 22 accept
                  ip protocol icmp accept
         }

         chain forward {
                  type filter hook forward priority 0;
                  drop
         }
}



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Reversed byte order issue with nft ?
  2014-12-03 17:20 Reversed byte order issue with nft ? leroy christophe
@ 2014-12-04 13:27 ` Pablo Neira Ayuso
  2014-12-05  6:40   ` leroy christophe
  0 siblings, 1 reply; 3+ messages in thread
From: Pablo Neira Ayuso @ 2014-12-04 13:27 UTC (permalink / raw)
  To: leroy christophe; +Cc: netfilter, netfilter-devel

On Wed, Dec 03, 2014 at 06:20:59PM +0100, leroy christophe wrote:
> Hi,
> 
> When doing 'nft list ruleset', I get a bad result (see below),
> fields appear as "unknown" and/or as numeric values.

Please, test this:

http://patchwork.ozlabs.org/patch/417775/

and confirm that this resolves your problem. Thank you.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Reversed byte order issue with nft ?
  2014-12-04 13:27 ` Pablo Neira Ayuso
@ 2014-12-05  6:40   ` leroy christophe
  0 siblings, 0 replies; 3+ messages in thread
From: leroy christophe @ 2014-12-05  6:40 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter, netfilter-devel

v2 tested, it works.

Thanks a lot.
Christophe

Le 04/12/2014 14:27, Pablo Neira Ayuso a écrit :
> On Wed, Dec 03, 2014 at 06:20:59PM +0100, leroy christophe wrote:
>> Hi,
>>
>> When doing 'nft list ruleset', I get a bad result (see below),
>> fields appear as "unknown" and/or as numeric values.
> Please, test this:
>
> http://patchwork.ozlabs.org/patch/417775/
>
> and confirm that this resolves your problem. Thank you.
>

--
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-12-05  6:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-03 17:20 Reversed byte order issue with nft ? leroy christophe
2014-12-04 13:27 ` Pablo Neira Ayuso
2014-12-05  6:40   ` leroy christophe

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.