From: Florian Westphal <fw@strlen.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Dan Williams <dcbw@redhat.com>, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH v3] libiptc: don't set_changed() when checking rules with module jumps
Date: Tue, 28 Feb 2017 13:03:07 +0100 [thread overview]
Message-ID: <20170228120307.GA6834@breakpoint.cc> (raw)
In-Reply-To: <20170228113312.GA19580@salvia>
Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> On Sat, Feb 25, 2017 at 10:02:03PM -0600, Dan Williams wrote:
> > Checking a rule that includes a jump to a module-based target currently
> > sets the "changed" flag on the handle, which then causes TC_COMMIT() to
> > run through the whole SO_SET_REPLACE/SO_SET_ADD_COUNTERS path. This
> > seems wrong for simply checking rules, an operation which is documented
> > as "...does not alter the existing iptables configuration..." but yet
> > it clearly could do so.
> >
> > Fix that by ensuring that rule check operations for module targets
> > don't set the changed flag, and thus exit early from TC_COMMIT().
>
> Thanks for explaining. How are you hitting this problem? I'm curious
> to see if I can reproduce it.
Its easy to reproduce.
iptables -t nat -o lo -A POSTROUTING -s 10.2.3.4 -j MASQUERADE
iptables -t nat -o lo -C POSTROUTING -s 10.2.3.4 -j MASQUERADE
you should see (via strace) that 2nd command also issues the iptables
setsockopt calls.
next prev parent reply other threads:[~2017-02-28 12:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-24 18:15 [PATCH] libiptc: don't set_changed() when checking rules with module jumps Dan Williams
2017-02-24 18:25 ` [PATCH v2] " Dan Williams
2017-02-25 10:59 ` Pablo Neira Ayuso
2017-02-26 4:02 ` [PATCH v3] " Dan Williams
2017-02-28 11:33 ` Pablo Neira Ayuso
2017-02-28 12:03 ` Florian Westphal [this message]
2017-02-28 12:18 ` 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=20170228120307.GA6834@breakpoint.cc \
--to=fw@strlen.de \
--cc=dcbw@redhat.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).