]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - include/net/netfilter/nf_conntrack_l4proto.h
netfilter: conntrack: don't cache nlattr_tuple_size result in nla_size
authorFlorian Westphal <fw@strlen.de>
Thu, 2 Nov 2017 18:41:09 +0000 (19:41 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 6 Nov 2017 15:48:38 +0000 (16:48 +0100)
commit5caaed151a68ae36aca2981cc245f5960a0a7603
tree3be849f6eb823d7ed84742fcf48b1234f22cc700
parent7f4dae2d7f03d2aaf3b7d8343d4509c8d9d7ca9b
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>
include/net/netfilter/nf_conntrack_l4proto.h
net/ipv4/netfilter/nf_conntrack_proto_icmp.c
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_conntrack_netlink.c
net/netfilter/nf_conntrack_proto.c
net/netfilter/nf_conntrack_proto_tcp.c