diff options
author | Florian Westphal <fw@strlen.de> | 2017-08-12 01:57:02 +0300 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2017-08-24 19:52:32 +0300 |
commit | 0d03510038bda70b5a4a252e8216822e6ce0cbdb (patch) | |
tree | 1c7acf5e1d75424f44404e2824521b341bd8e16f /net/netfilter/nf_conntrack_netlink.c | |
parent | eee6ebbac18a189ef33d25ea9b8bcae176515e49 (diff) | |
download | linux-0d03510038bda70b5a4a252e8216822e6ce0cbdb.tar.xz |
netfilter: conntrack: compute l3proto nla size at compile time
avoids a pointer and allows struct to be const later on.
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nf_conntrack_netlink.c')
-rw-r--r-- | net/netfilter/nf_conntrack_netlink.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index f4ca48817f66..b59a453a0fd8 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c @@ -540,7 +540,8 @@ static inline size_t ctnetlink_proto_size(const struct nf_conn *ct) size_t len = 0; l3proto = __nf_ct_l3proto_find(nf_ct_l3num(ct)); - len += l3proto->nla_size; + len = l3proto->nla_size; + len *= 3u; /* ORIG, REPLY, MASTER */ l4proto = __nf_ct_l4proto_find(nf_ct_l3num(ct), nf_ct_protonum(ct)); len += l4proto->nla_size; |