Skip to content

Commit e7eadb4

Browse files
Eric Dumazetdavem330
authored andcommitted
ipv6: inet6_sk() should use sk_fullsock()
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent caf3f26 commit e7eadb4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/linux/ipv6.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,9 @@ struct tcp6_timewait_sock {
264264
};
265265

266266
#if IS_ENABLED(CONFIG_IPV6)
267-
static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk)
267+
static inline struct ipv6_pinfo *inet6_sk(const struct sock *__sk)
268268
{
269-
return inet_sk(__sk)->pinet6;
269+
return sk_fullsock(__sk) ? inet_sk(__sk)->pinet6 : NULL;
270270
}
271271

272272
static inline struct raw6_sock *raw6_sk(const struct sock *sk)

0 commit comments

Comments
 (0)