Commit 7000d38d authored by Eric Leblond's avatar Eric Leblond Committed by David S. Miller

[NETFILTER]: nfnetlink_log: fix computation of netlink skb size

This patch is similar to nfnetlink_queue fixes. It fixes the computation
of skb size by using NLMSG_SPACE instead of NLMSG_ALIGN.
Signed-off-by: default avatarEric Leblond <eric@inl.fr>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cabaa9bf
...@@ -556,7 +556,7 @@ nfulnl_log_packet(unsigned int pf, ...@@ -556,7 +556,7 @@ nfulnl_log_packet(unsigned int pf,
/* FIXME: do we want to make the size calculation conditional based on /* FIXME: do we want to make the size calculation conditional based on
* what is actually present? way more branches and checks, but more * what is actually present? way more branches and checks, but more
* memory efficient... */ * memory efficient... */
size = NLMSG_ALIGN(sizeof(struct nfgenmsg)) size = NLMSG_SPACE(sizeof(struct nfgenmsg))
+ nla_total_size(sizeof(struct nfulnl_msg_packet_hdr)) + nla_total_size(sizeof(struct nfulnl_msg_packet_hdr))
+ nla_total_size(sizeof(u_int32_t)) /* ifindex */ + nla_total_size(sizeof(u_int32_t)) /* ifindex */
+ nla_total_size(sizeof(u_int32_t)) /* ifindex */ + nla_total_size(sizeof(u_int32_t)) /* ifindex */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment