]> git.baikalelectronics.ru Git - kernel.git/commit
netlink: use NETLINK_CB(in_skb).sk instead of looking it up
authorJohannes Berg <johannes.berg@intel.com>
Mon, 16 Oct 2017 14:57:49 +0000 (16:57 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Oct 2017 11:20:13 +0000 (12:20 +0100)
commit74b6bf26745a2d24aa907db6f3722e6d405b0209
tree5d356417907c15438b6f16933d8bfe823254b8c4
parent969bee8c9e30551d4d871c9c3c111a0b6f6d3548
netlink: use NETLINK_CB(in_skb).sk instead of looking it up

When netlink_ack() reports an allocation error to the sending
socket, there's no need to look up the sending socket since
it's available in the SKB's CB. Use that instead of going to
the trouble of looking it up.

Note that the pointer is only available since Eric Biederman's
commit c4e97af88f0a ("netlink: Make the sending netlink socket availabe in NETLINK_CB")
which is far newer than the original lookup code (Oct 2003)
(though the field was called 'ssk' in that commit and only got
renamed to 'sk' later, I'd actually argue 'ssk' was better - or
perhaps it should've been 'source_sk' - since there are so many
different 'sk's involved.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netlink/af_netlink.c