From: Eric Dumazet Date: Mon, 5 Oct 2015 04:08:09 +0000 (-0700) Subject: ipv6: inet6_sk() should use sk_fullsock() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b3a20fc392f857f11bb622cf5f05e6badc86d8b8;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git ipv6: inet6_sk() should use sk_fullsock() SYN_RECV & TIMEWAIT sockets are not full blown, they do not have a pinet6 pointer. Bug: 24163529 Change-Id: I6ce67a190d67d200c6ebeb81d2daeb9c86cd7581 Fixes: ca6fb0651883 ("tcp: attach SYNACK messages to request sockets instead of listener") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Lorenzo Colitti --- diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 768aa4fd507..63c32244773 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h @@ -274,9 +274,9 @@ static inline struct inet6_timewait_sock *inet6_twsk(const struct sock *sk) } #if IS_ENABLED(CONFIG_IPV6) -static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk) +static inline struct ipv6_pinfo *inet6_sk(const struct sock *__sk) { - return inet_sk(__sk)->pinet6; + return sk_fullsock(__sk) ? inet_sk(__sk)->pinet6 : NULL; } static inline struct inet6_request_sock *