From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Laura Garcia Liebana <nevola@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCHv2] extensions: libip6t_frag: Add translation to nft
Date: Tue, 7 Jun 2016 00:45:50 +0200 [thread overview]
Message-ID: <20160606224550.GA3040@salvia> (raw)
In-Reply-To: <20160606224345.GB2936@salvia>
On Tue, Jun 07, 2016 at 12:43:45AM +0200, Pablo Neira Ayuso wrote:
> On Mon, Jun 06, 2016 at 09:25:46PM +0200, Laura Garcia Liebana wrote:
> > Add translation for frag to nftables. According to the --fraglen code:
> >
> > case O_FRAGLEN:
> > /*
> > * As of Linux 3.0, the kernel does not check for
> > * fraglen at all.
> > */
> >
> > In addition, the kernel code doesn't show any reference to the flag
> > IP6T_FRAG_LEN, so this option is deprecated and won't be translated to
> > nft.
> >
> > Examples:
> >
> > $ sudo iptables-translate -t filter -A INPUT -m frag --fragid 100:200 -j ACCEPT
> > nft add rule ip6 filter INPUT frag id 100-200 counter accept
> >
> > $ sudo iptables-translate -t filter -A INPUT -m frag --fragid 100 --fragres --fragmore -j ACCEPT
> > nft add rule ip6 filter INPUT frag id 100 frag reserved 1 frag more-fragments 1 counter accept
> >
> > $ sudo iptables-translate -t filter -A INPUT -m frag ! --fragid 100:200 -j ACCEPT
> > nft add rule ip6 filter INPUT frag id != 100-200 counter accept
> >
> > $ sudo iptables-translate -t filter -A INPUT -m frag --fragid 100:200 --fraglast -j ACCEPT
> > nft add rule ip6 filter INPUT frag id 100-200 frag more-fragments 1 counter accept
> >
> > $ sudo iptables-translate -t filter -A INPUT -m frag --fragid 100:200 --fragfirst -j ACCEPT
> > nft add rule ip6 filter INPUT frag id 100-200 frag frag-off 0 counter accept
>
> Also applied, thanks.
Wait..
+static int frag_xlate(const void *ip, const struct xt_entry_match *match,
+ struct xt_xlate *xl, int numeric)
+{
+ const struct ip6t_frag *fraginfo = (struct ip6t_frag
*)match->data;
+
+ if (fraginfo->flags & IP6T_FRAG_LEN)
+ return 0;
You better ignore completely IP6T_FRAG_LEN as the kernelside does.
No need to give up on providing a translation if this is used,
instead, let's relax this.
So please, remove this check. Thanks.
prev parent reply other threads:[~2016-06-06 22:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-06 19:25 [PATCHv2] extensions: libip6t_frag: Add translation to nft Laura Garcia Liebana
2016-06-06 22:43 ` Pablo Neira Ayuso
2016-06-06 22:45 ` 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=20160606224550.GA3040@salvia \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=nevola@gmail.com \
/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).