summaryrefslogtreecommitdiff
path: root/net/netfilter/nf_conntrack_proto.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2017-11-02 19:41:09 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2017-11-06 16:48:38 +0100
commit5caaed151a68ae36aca2981cc245f5960a0a7603 (patch)
tree3be849f6eb823d7ed84742fcf48b1234f22cc700 /net/netfilter/nf_conntrack_proto.c
parent7f4dae2d7f03d2aaf3b7d8343d4509c8d9d7ca9b (diff)
netfilter: conntrack: don't cache nlattr_tuple_size result in nla_size
We currently call ->nlattr_tuple_size() once at register time and cache result in l4proto->nla_size. nla_size is the only member that is written to, avoiding this would allow to make l4proto trackers const. We can use ->nlattr_tuple_size() at run time, and cache result in the individual trackers instead. This is an intermediate step, next patch removes nlattr_size() callback and computes size at compile time, then removes nla_size. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nf_conntrack_proto.c')
-rw-r--r--net/netfilter/nf_conntrack_proto.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/net/netfilter/nf_conntrack_proto.c b/net/netfilter/nf_conntrack_proto.c
index 83f739e9dc08..3b06ff3f2dee 100644
--- a/net/netfilter/nf_conntrack_proto.c
+++ b/net/netfilter/nf_conntrack_proto.c
@@ -398,8 +398,6 @@ int nf_ct_l4proto_register_one(struct nf_conntrack_l4proto *l4proto)
l4proto->nla_size = 0;
if (l4proto->nlattr_size)
l4proto->nla_size += l4proto->nlattr_size();
- if (l4proto->nlattr_tuple_size)
- l4proto->nla_size += 3 * l4proto->nlattr_tuple_size();
rcu_assign_pointer(nf_ct_protos[l4proto->l3proto][l4proto->l4proto],
l4proto);