netlink: use 48 byte ctx instead of 6 signed longs for callback
authorJason A. Donenfeld <Jason@zx2c4.com>
Fri, 28 Jun 2019 14:40:21 +0000 (16:40 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 2 Jul 2019 02:12:10 +0000 (19:12 -0700)
commit362b87f5b1c6603b72699e8bb18661ecc4efc0bb
tree8f2019d80b6f5eee9c5036fea8650b773f3614b6
parent53962bcea9975a33669ba03e06111df636048bb1
netlink: use 48 byte ctx instead of 6 signed longs for callback

People are inclined to stuff random things into cb->args[n] because it
looks like an array of integers. Sometimes people even put u64s in there
with comments noting that a certain member takes up two slots. The
horror! Really this should mirror the usage of skb->cb, which are just
48 opaque bytes suitable for casting a struct. Then people can create
their usual casting macros for accessing strongly typed members of a
struct.

As a plus, this also gives us the same amount of space on 32bit and 64bit.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netlink.h