net/tcp: refactor tcp_inet6_sk()
authorPavel Begunkov <asml.silence@gmail.com>
Fri, 19 May 2023 13:30:36 +0000 (14:30 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 May 2023 10:22:58 +0000 (11:22 +0100)
commitfe79bd65c819cc520aa66de65caae8e4cea29c5a
tree33015363adb396d45edc5e721ab5938fef7be794
parent4b159f5048b90844679dad08afb3240c1957aba1
net/tcp: refactor tcp_inet6_sk()

Don't keep hand coded offset caluclations and replace it with
container_of(). It should be type safer and a bit less confusing.

It also makes it with a macro instead of inline function to preserve
constness, which was previously casted out like in case of
tcp_v6_send_synack().

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/tcp_ipv6.c