netfilter: merge udp and udplite trackers
Subsystems (2)
Florian Westphal
maintainerv2 cover netfilter: merge udp and udplite trackers
Most of the code is copy&paste from the udp one; most of the udp functions can also be used for udplite.
include/net/netfilter/ipv4/nf_conntrack_ipv4.h | 1 include/net/netfilter/ipv6/nf_conntrack_ipv6.h | 1 include/net/netns/conntrack.h | 16 - net/netfilter/Makefile | 2 net/netfilter/nf_conntrack_proto_udp.c | 123 ++++++++ net/netfilter/nf_nat_proto_udp.c | 78 ++++- net/netfilter/nf_conntrack_proto_udplite.c | 324 ----------------------- net/netfilter/nf_nat_proto_udplite.c | 73 ----- 8 files changed, 191 insertions(+), 427 deletions(-)
Florian Westphal
maintainerPATCH v2 1/2 netfilter: merge udp and udplite conntrack helpers
udplite was copied from udp, they are virtually 100% identical.
This adds udplite tracker to udp instead, removes udplite module, and then makes the udplite tracker builtin.
udplite will then simply re-use udp timeout settings. It makes little sense to add separate sysctls, nowadays we have fine-grained timeout policy support via the CT target.
old:
text data bss dec hex filename 1633 672 0 2305 901 nf_conntrack_proto_udp.o 1756 672 0 2428 97c nf_conntrack_proto_udplite.o
69526 17937 268 87731 156b3 nf_conntrack.ko
new:
text data bss dec hex filename 2442 1184 0 3626 e2a nf_conntrack_proto_udp.o
68565 17721 268 86554 1521a nf_conntrack.ko
---
Change since v1: rebase on current master
include/net/netfilter/ipv4/nf_conntrack_ipv4.h | 1 + include/net/netfilter/ipv6/nf_conntrack_ipv6.h | 1 + include/net/netns/conntrack.h | 16 -- net/netfilter/Makefile | 1 - net/netfilter/nf_conntrack_proto_udp.c | 123 ++++++++++ net/netfilter/nf_conntrack_proto_udplite.c | 324 ------------------------- 6 files changed, 125 insertions(+), 341 deletions(-) delete mode 100644 net/netfilter/nf_conntrack_proto_udplite.c
include/net/netfilter/ipv4/nf_conntrack_ipv4.h +1 -0
@@ -14,6 +14,7 @@ extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4;extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp4;extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4; +extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udplite4;extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp;#ifdef CONFIG_NF_CT_PROTO_DCCP extern struct nf_conntrack_l4proto nf_conntrack_l4proto_dccp4;
include/net/netfilter/ipv6/nf_conntrack_ipv6.h +1 -0
@@ -5,6 +5,7 @@ extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv6;extern struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp6;extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6; +extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udplite6;extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6;#ifdef CONFIG_NF_CT_PROTO_DCCP extern struct nf_conntrack_l4proto nf_conntrack_l4proto_dccp6;
include/net/netns/conntrack.h +0 -16
@@ -69,19 +69,6 @@ struct nf_sctp_net { };#endif -#ifdef CONFIG_NF_CT_PROTO_UDPLITE -enum udplite_conntrack { -UDPLITE_CT_UNREPLIED , -UDPLITE_CT_REPLIED , -UDPLITE_CT_MAX -}; - -struct nf_udplite_net { -struct nf_proto_net pn; -unsigned int timeouts[UDPLITE_CT_MAX ]; -}; -#endif -struct nf_ip_net {struct nf_generic_net generic;struct nf_tcp_net tcp;
@@ -94,9 +81,6 @@ struct nf_ip_net {#ifdef CONFIG_NF_CT_PROTO_SCTP struct nf_sctp_net sctp;#endif -#ifdef CONFIG_NF_CT_PROTO_UDPLITE -struct nf_udplite_net udplite; -#endif };struct ct_pcpu {
net/netfilter/Makefile +0 -1
@@ -7,7 +7,6 @@ nf_conntrack-$(CONFIG_NF_CONNTRACK_EVENTS) += nf_conntrack_ecache.o nf_conntrack-$(CONFIG_NF_CONNTRACK_LABELS) += nf_conntrack_labels.o nf_conntrack-$(CONFIG_NF_CT_PROTO_DCCP) += nf_conntrack_proto_dccp.o nf_conntrack-$(CONFIG_NF_CT_PROTO_SCTP) += nf_conntrack_proto_sctp.o -nf_conntrack-$(CONFIG_NF_CT_PROTO_UDPLITE) += nf_conntrack_proto_udplite.o obj-$(CONFIG_NETFILTER) = netfilter.o
net/netfilter/nf_conntrack_proto_udp.c +123 -0
138 lines not on this page · raw message
net/netfilter/nf_conntrack_proto_udplite.c deleted +0 -324
324 lines not on this page · raw message
Signature · 1 line
2.7.3
Florian Westphal
maintainerPATCH v2 2/2 netfilter: nat: merge udp and udplite helpers
In reply to Florian Westphaludplite nat was copied from udp nat, they are virtually 100% identical. Not really surprising given udplite is just udp with partial csum coverage.
old:
text data bss dec hex filename
11606 1457 210 13273 33d9 nf_nat.ko
330 0 2 332 14c nf_nat_proto_udp.o
276 0 2 278 116 nf_nat_proto_udplite.o
new:
text data bss dec hex filename
11598 1457 210 13265 33d1 nf_nat.ko
640 0 4 644 284 nf_nat_proto_udp.o---
Change since v1: rebase on current master
net/netfilter/Makefile | 1 - net/netfilter/nf_nat_proto_udp.c | 78 ++++++++++++++++++++++++++++++------ net/netfilter/nf_nat_proto_udplite.c | 73 --------------------------------- 3 files changed, 66 insertions(+), 86 deletions(-) delete mode 100644 net/netfilter/nf_nat_proto_udplite.c
net/netfilter/Makefile +0 -1
@@ -46,7 +46,6 @@ nf_nat-y := nf_nat_core.o nf_nat_proto_unknown.o nf_nat_proto_common.o \ # NAT protocols (nf_nat) nf_nat-$(CONFIG_NF_NAT_PROTO_DCCP) += nf_nat_proto_dccp.o nf_nat-$(CONFIG_NF_NAT_PROTO_SCTP) += nf_nat_proto_sctp.o -nf_nat-$(CONFIG_NF_NAT_PROTO_UDPLITE) += nf_nat_proto_udplite.o # generic transport layer logging obj-$(CONFIG_NF_LOG_COMMON) += nf_log_common.o
net/netfilter/nf_nat_proto_udp.c +66 -12
102 lines not on this page · raw message
net/netfilter/nf_nat_proto_udplite.c deleted +0 -73
73 lines not on this page · raw message
Signature · 1 line
2.7.3
Pablo Neira Ayuso
maintainerQuoted 2 lines · Florian Westphal
Most of the code is copy&paste from the udp one; most of the udp functions can also be used for udplite.
Series applied, thanks Florian.