netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: leroy christophe <christophe.leroy@c-s.fr>
To: Pablo Neira Ayuso <pablo@netfilter.org>,
	netfilter@vger.kernel.org, netfilter-devel@vger.kernel.org
Subject: Reversed byte order issue with nft ?
Date: Wed, 03 Dec 2014 18:20:59 +0100	[thread overview]
Message-ID: <547F467B.3060206@c-s.fr> (raw)

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
         }
}



             reply	other threads:[~2014-12-03 17:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-03 17:20 leroy christophe [this message]
2014-12-04 13:27 ` Reversed byte order issue with nft ? Pablo Neira Ayuso
2014-12-05  6:40   ` leroy christophe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=547F467B.3060206@c-s.fr \
    --to=christophe.leroy@c-s.fr \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=netfilter@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).