Skip to content

Commit

Permalink
ipv6: inet6_sk() should use sk_fullsock()
Browse files Browse the repository at this point in the history
SYN_RECV & TIMEWAIT sockets are not full blown, they do not have a pinet6
pointer.

Fixes: ca6fb06 ("tcp: attach SYNACK messages to request sockets instead of listener")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Oct 5, 2015
1 parent caf3f26 commit e7eadb4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/linux/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ struct tcp6_timewait_sock {
};

#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 raw6_sock *raw6_sk(const struct sock *sk)
Expand Down

0 comments on commit e7eadb4

Please sign in to comment.