netfilter: ctnetlink: allocate right-sized ctnetlink skb
authorHolger Eitzenberger <holger@eitzenberger.org>
Wed, 25 Mar 2009 20:50:59 +0000 (21:50 +0100)
committerPatrick McHardy <kaber@trash.net>
Wed, 25 Mar 2009 20:50:59 +0000 (21:50 +0100)
commit2732c4e45bb67006fdc9ae6669be866762711ab5
treed9ab37014adad2709cbb0a198eb2c48921d62420
parentea781f197d6a835cbb93a0bf88ee1696296ed8aa
netfilter: ctnetlink: allocate right-sized ctnetlink skb

Try to allocate a Netlink skb roughly the size of the actual
message, with the help from the l3 and l4 protocol helpers.
This is all to prevent a reallocation in netlink_trim() later.

The overhead of allocating the right-sized skb is rather small, with
ctnetlink_alloc_skb() actually being inlined away on my x86_64 box.
The size of the per-proto space is determined at registration time of
the protocol helper.

Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
net/netfilter/nf_conntrack_netlink.c