Linux Netfilter development
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Albert Veli <albert.veli@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: libnetfilter_conntrack endian issue
Date: Tue, 29 Jul 2008 13:52:46 +0200	[thread overview]
Message-ID: <488F048E.5020202@netfilter.org> (raw)
In-Reply-To: <4e0fd89b0807290324v6f771a79q80dcafc6b03dae54@mail.gmail.com>

Albert Veli wrote:
> Hi!
> 
> I run contrack-tools on a big-endian arm machine and had a problem:
> 
> $ conntrack -L
> conntrack v0.9.7: Operation failed: Address family not supported by protocol
> 
> The problem was in libnetfilter_conntrack-0.0.96/src/conntrack/api.c.
> See attached endian.patch. In nfct_build_query() the *data argument is
> converted into a u_int8_t*. This works for little-endian but not for
> big-endian. The fix is a one-liner. Replace
> 
>  const u_int8_t *family = data;
> 
> with
> 
>  const u_int32_t *family = data;
> 
> After the patch it works:
> 
> $ conntrack -L
> conntrack v0.9.7: 0 flow entries has been shown.
> 
> I also tested the patch on my little-endian laptop and it doesn't seem
> to cause any regression there. Just wanted to let you guys know.

Applied. Thanks Albert.

-- 
"Los honestos son inadaptados sociales" -- Les Luthiers

      reply	other threads:[~2008-07-29 11:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-29 10:24 libnetfilter_conntrack endian issue Albert Veli
2008-07-29 11:52 ` Pablo Neira Ayuso [this message]

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=488F048E.5020202@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=albert.veli@gmail.com \
    --cc=netfilter-devel@vger.kernel.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