From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Phil Sutter <phil@nwl.cc>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [iptables PATCH] nft_ipv{4,6}_xlate: Respect prefix lengths
Date: Tue, 29 Nov 2016 23:01:17 +0100 [thread overview]
Message-ID: <20161129220117.GC29033@salvia> (raw)
In-Reply-To: <20161125175255.11878-1-phil@nwl.cc>
On Fri, Nov 25, 2016 at 06:52:55PM +0100, Phil Sutter wrote:
> This was an annoying bug in the translator since it silently dropped
> crucial information which is easily overlooked:
>
> | $ iptables-translate -A INPUT -s 192.168.0.0/24 -j ACCEPT
> | nft add rule ip filter INPUT ip saddr 192.168.0.0 counter accept
> | $ ip6tables-translate -A INPUT -s feed:babe::/64 -j ACCEPT
> | nft add rule ip6 filter INPUT ip6 saddr feed:babe:: counter accept
>
> To my surprise, this fix works really well in all kinds of situations:
>
> | $ iptables-translate -A INPUT -s 1.2.3.4/0 -j ACCEPT
> | nft add rule ip filter INPUT counter accept
> |
> | $ iptables-translate -A INPUT -s 1.2.3.4/23 -j ACCEPT
> | nft add rule ip filter INPUT ip saddr 1.2.2.0/23 counter accept
> |
> | $ iptables-translate -A INPUT -s 1.2.3.4/24 -j ACCEPT
> | nft add rule ip filter INPUT ip saddr 1.2.3.0/24 counter accept
> |
> | $ iptables-translate -A INPUT -s 1.2.3.4/32 -j ACCEPT
> | nft add rule ip filter INPUT ip saddr 1.2.3.4 counter accept
> |
> | $ iptables-translate -A INPUT -s 1.2.3.4/255.255.0.0 -j ACCEPT
> | nft add rule ip filter INPUT ip saddr 1.2.0.0/16 counter accept
>
> Ditto for IPv6.
Applied, thanks!
prev parent reply other threads:[~2016-11-29 22:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-25 17:52 [iptables PATCH] nft_ipv{4,6}_xlate: Respect prefix lengths Phil Sutter
2016-11-29 22:01 ` 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=20161129220117.GC29033@salvia \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=phil@nwl.cc \
/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