af_unix: Set TCP_ESTABLISHED for datagram sockets too
authorCong Wang <cong.wang@bytedance.com>
Sun, 4 Jul 2021 19:02:45 +0000 (12:02 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 16 Jul 2021 01:17:50 +0000 (18:17 -0700)
commit83301b5367a98c17ec0d76c7bc0ccdc3c7e7ad6d
tree41df0f676467ff7bf58da5bef2384923144ceed7
parent29df44fa52b70c330d8f2a3871e028a3522b8494
af_unix: Set TCP_ESTABLISHED for datagram sockets too

Currently only unix stream socket sets TCP_ESTABLISHED,
datagram socket can set this too when they connect to its
peer socket. At least __ip4_datagram_connect() does the same.

This will be used to determine whether an AF_UNIX datagram
socket can be redirected to in sockmap.

Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210704190252.11866-5-xiyou.wangcong@gmail.com
net/unix/af_unix.c