netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Alvaro Neira Ayuso <alvaroneay@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [nft PATCH v2] src: add specific byteorder to the struct proto_hdr_template
Date: Wed, 17 Sep 2014 09:24:50 +0200	[thread overview]
Message-ID: <20140917072450.GA6690@acer.localdomain> (raw)
In-Reply-To: <1410870079-11421-1-git-send-email-alvaroneay@gmail.com>

On Tue, Sep 16, 2014 at 02:21:19PM +0200, Alvaro Neira Ayuso wrote:
> If we try to add a rule like:
> 
> nft add rule filter input udp length {55-9999}
> 
> nftable shows:
> 
> BUG: invalid byte order conversion 0 => 2
> nft: src/evaluate.c:153: byteorder_conversion_op: Assertion `0' failed.
> 
> Some of the existing payload fields rely on BYTEORDER_INVALID. Therefore, if we
> try to convert it in evaluation step, we hit this bug.
> 
> This patch allows to add a specific byteorder to the struct proto_hdr_template. If
> we create a expression with a invalid byteorder, we will use the byteorder
> added to the proto_hdr_template structure.
> 
> Signed-off-by: Alvaro Neira Ayuso <alvaroneay@gmail.com>
> ---
> [Changes in v2]
> * Use host endian byteorder in the ether saddr/daddr rules.
> 
> [Tested with the rules]
> nft add rule ip filter input ip length 10-55 counter
> nft add rule ip filter input ip length 55-1000 counter
> nft add rule ip filter input udp length {0-100} udp dport 9999 counter
> nft add rule ip filter input udp length {100-9999} udp dport 9999 counter
> nft add rule bridge filter input ether type 0x0800 counter
> nft add rule bridge filter input ether saddr 12:34:56:78.9a:bc counter
> nft add rule bridge filter input ether daddr 12:34:56:78:9a:bc counter
> Tested with the Ana Rey's tests

Applied, thanks Alvaro.

      reply	other threads:[~2014-09-17  7:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-09 16:01 [nft PATCH] src: add specific byteorder to the struct proto_hdr_template Alvaro Neira Ayuso
2014-09-16 12:21 ` [nft PATCH v2] " Alvaro Neira Ayuso
2014-09-17  7:24   ` Patrick McHardy [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=20140917072450.GA6690@acer.localdomain \
    --to=kaber@trash.net \
    --cc=alvaroneay@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;
as well as URLs for NNTP newsgroup(s).