From: Patrick McHardy <kaber@trash.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Alvaro Neira Ayuso <alvaroneay@gmail.com>,
netfilter-devel@vger.kernel.org
Subject: Re: [nft PATCH 2/4 v3] src: fix byteorder conversions in simple values
Date: Thu, 31 Jul 2014 19:01:31 +0200 [thread overview]
Message-ID: <20140731170131.GA26503@server.your-server.de> (raw)
In-Reply-To: <20140730111414.GA3674@salvia>
On Wed, Jul 30, 2014 at 01:14:14PM +0200, Pablo Neira Ayuso wrote:
> Some comments below.
>
> On Tue, Jul 29, 2014 at 07:09:55PM +0200, Alvaro Neira Ayuso wrote:
> > --- a/src/datatype.c
> > +++ b/src/datatype.c
> > @@ -255,8 +255,11 @@ static struct error_record *integer_type_parse(const struct expr *sym,
> > sym->dtype->desc);
> > }
> >
> > + /* If we use integer type, we must to convert it to big endian for
> > + * using it in internet format (big endian).
> > + */
> > *res = constant_expr_alloc(&sym->location, sym->dtype,
> > - BYTEORDER_HOST_ENDIAN, 1, NULL);
> > + BYTEORDER_BIG_ENDIAN, 1, NULL);
>
> I guess sym->dtype->byteorder still indicates invalid byteorder when
> you call datatype_parse, right?
This all looks quite strange to me. When parsing the integer it is
of course always in host byteorder. We simply need to add the conversion
in the correct spot, this should be quite minimal.
Please do not apply any of these patches until I can get a good look at
this. Should get a new notebook any day now.
Thanks.
next prev parent reply other threads:[~2014-07-31 17:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1406548146-31317-3-git-send-email-alvaroneay@gmail.com>
2014-07-29 17:09 ` [nft PATCH 2/4 v3] src: fix byteorder conversions in simple values Alvaro Neira Ayuso
2014-07-30 11:14 ` Pablo Neira Ayuso
2014-07-31 17:01 ` Patrick McHardy [this message]
2014-07-31 17:26 ` Pablo Neira Ayuso
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=20140731170131.GA26503@server.your-server.de \
--to=kaber@trash.net \
--cc=alvaroneay@gmail.com \
--cc=netfilter-devel@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).