All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Stefan Tomanek <stefan.tomanek@wertarbyte.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] iptables: add -C to check for existing rules
Date: Tue, 08 Mar 2011 15:57:45 +0100	[thread overview]
Message-ID: <4D7643E9.4050801@trash.net> (raw)
In-Reply-To: <20110308115639.GA30013@zirkel.wertarbyte.de>

Am 08.03.2011 12:56, schrieb Stefan Tomanek:
> It is often useful to check whether a specific rule is already present
> in a chain without actually modifying the iptables config.
> 
> Services like fail2ban usually employ techniques like grepping through
> the output of "iptables -L" which is quite error prone.
> 
> This patch adds a new operation -C to the iptables command which mostly
> works like -D; it can detect and indicate the existence of the specified
> rule by modifying the exit code. The new operation TC_CHECK_ENTRY uses
> the same code as the -D operation, whose functions got a dry-run
> parameter appended.

Looks fine to me. I'll apply this if nobody else objects.

  reply	other threads:[~2011-03-08 14:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-08 11:56 [PATCH] iptables: add -C to check for existing rules Stefan Tomanek
2011-03-08 14:57 ` Patrick McHardy [this message]
2011-03-08 18:57 ` Jan Engelhardt
2011-03-08 21:15   ` Stefan Tomanek
2011-03-08 21:42   ` Stefan Tomanek
2011-03-08 22:20     ` Jan Engelhardt

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=4D7643E9.4050801@trash.net \
    --to=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=stefan.tomanek@wertarbyte.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.