From: Vasily Averin <vvs@parallels.com>
To: Florian Westphal <fw@strlen.de>, Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org, Patrick McHardy <kaber@trash.net>
Subject: [PATCH 6/7] nf: ipv4 defragmentation users counter changes in xt_socket match
Date: Mon, 05 May 2014 16:56:28 +0400 [thread overview]
Message-ID: <53678A7C.9030701@parallels.com> (raw)
In-Reply-To: <cover.1399292146.git.vvs@openvz.org>
Signed-off-by: Vasily Averin <vvs@openvz.org>
---
net/netfilter/xt_socket.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/net/netfilter/xt_socket.c b/net/netfilter/xt_socket.c
index 1ba6793..982bd58 100644
--- a/net/netfilter/xt_socket.c
+++ b/net/netfilter/xt_socket.c
@@ -388,6 +388,12 @@ socket_mt6_v1_v2(const struct sk_buff *skb, struct xt_action_param *par)
}
#endif
+static int socket_mt4_v0_check(const struct xt_mtchk_param *par)
+{
+ inc_br_defrag_ipv4_users_count(par->net);
+ return 0;
+}
+
static int socket_mt_v1_check(const struct xt_mtchk_param *par)
{
const struct xt_socket_mtinfo1 *info = (struct xt_socket_mtinfo1 *) par->matchinfo;
@@ -396,6 +402,8 @@ static int socket_mt_v1_check(const struct xt_mtchk_param *par)
pr_info("unknown flags 0x%x\n", info->flags & ~XT_SOCKET_FLAGS_V1);
return -EINVAL;
}
+ if (par->family == NFPROTO_IPV4)
+ inc_br_defrag_ipv4_users_count(par->net);
return 0;
}
@@ -407,15 +415,24 @@ static int socket_mt_v2_check(const struct xt_mtchk_param *par)
pr_info("unknown flags 0x%x\n", info->flags & ~XT_SOCKET_FLAGS_V2);
return -EINVAL;
}
+ if (par->family == NFPROTO_IPV4)
+ inc_br_defrag_ipv4_users_count(par->net);
return 0;
}
+static void socket_mt4_destroy(const struct xt_mtdtor_param *par)
+{
+ dec_br_defrag_ipv4_users_count(par->net);
+}
+
static struct xt_match socket_mt_reg[] __read_mostly = {
{
.name = "socket",
.revision = 0,
.family = NFPROTO_IPV4,
.match = socket_mt4_v0,
+ .checkentry = socket_mt4_v0_check,
+ .destroy = socket_mt4_destroy,
.hooks = (1 << NF_INET_PRE_ROUTING) |
(1 << NF_INET_LOCAL_IN),
.me = THIS_MODULE,
@@ -426,6 +443,7 @@ static struct xt_match socket_mt_reg[] __read_mostly = {
.family = NFPROTO_IPV4,
.match = socket_mt4_v1_v2,
.checkentry = socket_mt_v1_check,
+ .destroy = socket_mt4_destroy,
.matchsize = sizeof(struct xt_socket_mtinfo1),
.hooks = (1 << NF_INET_PRE_ROUTING) |
(1 << NF_INET_LOCAL_IN),
@@ -450,6 +468,7 @@ static struct xt_match socket_mt_reg[] __read_mostly = {
.family = NFPROTO_IPV4,
.match = socket_mt4_v1_v2,
.checkentry = socket_mt_v2_check,
+ .destroy = socket_mt4_destroy,
.matchsize = sizeof(struct xt_socket_mtinfo1),
.hooks = (1 << NF_INET_PRE_ROUTING) |
(1 << NF_INET_LOCAL_IN),
--
1.7.5.4
next prev parent reply other threads:[~2014-05-05 12:58 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20140430092905.GA4318@localhost>
2014-05-02 15:40 ` [PATCH RFC] Bridge: do not defragment packets unless connection tracking is enabled Vasily Averin
2014-05-02 22:55 ` Florian Westphal
2014-05-03 7:15 ` Vasily Averin
2014-05-03 7:18 ` [PATCH RFC v2] " Vasily Averin
2014-05-03 23:39 ` [PATCH RFC] " Pablo Neira Ayuso
2014-05-04 0:23 ` Florian Westphal
2014-05-04 11:15 ` Pablo Neira Ayuso
2014-05-04 20:06 ` Bart De Schuymer
2014-05-04 23:01 ` Pablo Neira Ayuso
2014-05-05 12:55 ` [PATCH RFC 0/7] users counter to manage ipv4 defragmentation on bridge Vasily Averin
2014-05-05 20:57 ` Florian Westphal
2014-05-07 13:27 ` Vasily Averin
2014-05-07 18:49 ` Bart De Schuymer
[not found] ` <cover.1399292146.git.vvs@openvz.org>
2014-05-05 12:55 ` [PATCH 1/7] nf: added per net namespace ipv4 defragmentation users counter Vasily Averin
2014-05-05 12:55 ` [PATCH 2/7] nf: initialization of " Vasily Averin
2014-05-05 12:56 ` [PATCH 3/7] nf: increment and decrement functions for " Vasily Averin
2014-05-05 12:56 ` [PATCH 4/7] nf: ipv4 defragmentation users counter changes in nf_conntrack_ipv4 module Vasily Averin
2014-05-05 12:56 ` [PATCH 5/7] nf: ipv4 defragmentation users counter changes in TPROXY target Vasily Averin
2014-05-05 12:56 ` Vasily Averin [this message]
2014-05-05 12:56 ` [PATCH 7/7] nf: use counter to manage ipv4 defragmentation on bridge Vasily Averin
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=53678A7C.9030701@parallels.com \
--to=vvs@parallels.com \
--cc=fw@strlen.de \
--cc=kaber@trash.net \
--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 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.