From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Jan Engelhardt <jengelh@computergmbh.de>
Cc: Netfilter Developer Mailing List
<netfilter-devel@lists.netfilter.org>,
kaber@trash.net
Subject: Re: xt_connlimit kernel 20070620
Date: Wed, 20 Jun 2007 11:47:14 +0200 [thread overview]
Message-ID: <4678F7A2.6090203@netfilter.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0706200039290.5731@fbirervta.pbzchgretzou.qr>
Jan Engelhardt wrote:
> Adds the xt_connlimit match to the kernel.
>
> Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
>
> ---
> include/linux/netfilter/xt_connlimit.h | 14 +
> net/netfilter/Kconfig | 7
> net/netfilter/Makefile | 1
> net/netfilter/xt_connlimit.c | 259 +++++++++++++++++++++++++++++++++
> 4 files changed, 281 insertions(+)
>
> Index: linux-2.6.22/include/linux/netfilter/xt_connlimit.h
> ===================================================================
> --- /dev/null
> +++ linux-2.6.22/include/linux/netfilter/xt_connlimit.h
> @@ -0,0 +1,14 @@
> +#ifndef _XT_CONNLIMIT_H
> +#define _XT_CONNLIMIT_H
> +
> +struct xt_connlimit_data;
> +
> +struct xt_connlimit_info {
> + u_int32_t mask;
> + unsigned int limit, inverse;
> +
> + /* this needs to be at the end */
> + struct xt_connlimit_data *data;
^^^
IIRC, this should be:
struct xt_connlimit_data __attribute__((aligned(8))) *data;
to avoid problems with 32/64 bits architectures.
> +};
> +
> +#endif /* _XT_CONNLIMIT_H */
> Index: linux-2.6.22/net/netfilter/xt_connlimit.c
> ===================================================================
[...]
> +
> + if (found_ct->proto.tcp.state == TCP_CONNTRACK_TIME_WAIT) {
> + /*
> + * we do not care about connections which are
> + * closed already -> ditch it
> + */
> + lh = lh->prev;
> + list_del(lh->next);
> + kfree(conn);
> + nf_conntrack_put(&found_ct->ct_general);
> + continue;
> + }
This match seems completely dependent of TCP. I think that it would be
worth a rework. Luke, use the connection tracking event API :)
--
The dawn of the fourth age of Linux firewalling is coming; a time of
great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris
next prev parent reply other threads:[~2007-06-20 9:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-19 22:41 xt_connlimit kernel 20070620 Jan Engelhardt
2007-06-19 22:41 ` xt_connlimit iptables 20070620 Jan Engelhardt
2007-06-19 22:45 ` xt_connlimit kernel 20070620 Jan Engelhardt
2007-06-20 9:47 ` Pablo Neira Ayuso [this message]
2007-06-20 10:29 ` Jan Engelhardt
2007-06-20 11:07 ` Pablo Neira Ayuso
2007-06-20 11:32 ` Jan Engelhardt
2007-06-20 12:01 ` Pablo Neira Ayuso
2007-06-20 12:35 ` Jan Engelhardt
2007-06-20 12:47 ` Patrick McHardy
2007-06-20 12:56 ` Jan Engelhardt
2007-06-21 15:39 ` Pablo Neira Ayuso
2007-06-21 15:44 ` Patrick McHardy
2007-06-21 15:50 ` Pablo Neira Ayuso
2007-06-21 15:51 ` Patrick McHardy
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=4678F7A2.6090203@netfilter.org \
--to=pablo@netfilter.org \
--cc=jengelh@computergmbh.de \
--cc=kaber@trash.net \
--cc=netfilter-devel@lists.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 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.