Skip to contentSkip to conversation

netfilter: synproxy: only register hooks when needed

PATCH In review Florian Westphal 1 participant 2 messages Apr 19, 2017

Subsystems (2)
lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 1/1 netfilter: synproxy: only register hooks when needed

Defer registration of the synproxy hooks until the first SYNPROXY rule is added. Also means we only register hooks in namespaces that need it.

---
 include/net/netfilter/nf_conntrack_synproxy.h |  2 +
 net/ipv4/netfilter/ipt_SYNPROXY.c             | 73 ++++++++++++++-------------
 net/ipv6/netfilter/ip6t_SYNPROXY.c            | 73 ++++++++++++++-------------
 3 files changed, 80 insertions(+), 68 deletions(-)
include/net/netfilter/nf_conntrack_synproxy.h +2 -0
index b0ca402c1f72..a2fcb5271726 100644
@@ -52,6 +52,8 @@ struct synproxy_stats {
 struct synproxy_net {
 	struct nf_conn			*tmpl;
 	struct synproxy_stats __percpu	*stats;
+	unsigned int			hook_ref4;
+	unsigned int			hook_ref6;
 };
 
 extern unsigned int synproxy_net_id;
net/ipv4/netfilter/ipt_SYNPROXY.c +39 -34

104 lines not on this page · raw message

net/ipv6/netfilter/ip6t_SYNPROXY.c +39 -34

105 lines not on this page · raw message

Signature · 1 line
2.10.2
author maintainer
#1 lore raw
Quoted 2 lines · Florian Westphal

Defer registration of the synproxy hooks until the first SYNPROXY rule is added. Also means we only register hooks in namespaces that need it.

On a related note: should I bother with CLUSTERIP or can be remove it?