net: init sk_cookie for inet socket
authorYafang Shao <laoar.shao@gmail.com>
Sun, 22 Apr 2018 13:50:04 +0000 (21:50 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 23 Apr 2018 15:56:44 +0000 (11:56 -0400)
commitc6849a3ac17e336811f1d5bba991d2a9bdc47af1
treeb7348427ce20d56554deaabba280b190f46d9cb1
parentec8c360a6ecdea595aff957c6a720e059275f1f4
net: init sk_cookie for inet socket

With sk_cookie we can identify a socket, that is very helpful for
traceing and statistic, i.e. tcp tracepiont and ebpf.
So we'd better init it by default for inet socket.
When using it, we just need call atomic64_read(&sk->sk_cookie).

Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/sock_diag.h
net/ipv4/tcp_input.c