aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/tcp_ipv6.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r--net/ipv6/tcp_ipv6.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index eec814fe53b8..82018bdce863 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -93,12 +93,13 @@ static struct tcp_md5sig_key *tcp_v6_md5_do_lookup(const struct sock *sk,
93/* Helper returning the inet6 address from a given tcp socket. 93/* Helper returning the inet6 address from a given tcp socket.
94 * It can be used in TCP stack instead of inet6_sk(sk). 94 * It can be used in TCP stack instead of inet6_sk(sk).
95 * This avoids a dereference and allow compiler optimizations. 95 * This avoids a dereference and allow compiler optimizations.
96 * It is a specialized version of inet6_sk_generic().
96 */ 97 */
97static struct ipv6_pinfo *tcp_inet6_sk(const struct sock *sk) 98static struct ipv6_pinfo *tcp_inet6_sk(const struct sock *sk)
98{ 99{
99 struct tcp6_sock *tcp6 = container_of(tcp_sk(sk), struct tcp6_sock, tcp); 100 unsigned int offset = sizeof(struct tcp6_sock) - sizeof(struct ipv6_pinfo);
100 101
101 return &tcp6->inet6; 102 return (struct ipv6_pinfo *)(((u8 *)sk) + offset);
102} 103}
103 104
104static void inet6_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb) 105static void inet6_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb)