• Johannes Berg's avatar
    netlink: use NETLINK_CB(in_skb).sk instead of looking it up · a2084f56
    Johannes Berg authored
    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 3fbc2905 ("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: default avatarJohannes Berg <johannes.berg@intel.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    a2084f56
af_netlink.c 63.5 KB