diff options
author | Eric Dumazet <edumazet@google.com> | 2019-04-01 03:09:20 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-01 10:21:21 -0700 |
commit | f5d547676ca068e10934687f59ac1e798eaae87a (patch) | |
tree | 9c77da7b0c94136ad6eff3f19a0a289f3b7430df /net/dsa/dsa2.c | |
parent | 6578229d4efb7ea6287861bfc2bd306140458e07 (diff) | |
download | linux-f5d547676ca068e10934687f59ac1e798eaae87a.tar.bz2 |
tcp: fix tcp_inet6_sk() for 32bit kernels
It turns out that struct ipv6_pinfo is not located as we think.
inet6_sk_generic() and tcp_inet6_sk() disagree on 32bit kernels by 4-bytes,
because struct tcp_sock has 8-bytes alignment,
but ipv6_pinfo size is not a multiple of 8.
sizeof(struct ipv6_pinfo): 116 (not padded to 8)
I actually first coded tcp_inet6_sk() as this patch does, but thought
that "container_of(tcp_sk(sk), struct tcp6_sock, tcp)" was cleaner.
As Julian told me : Nobody should use tcp6_sock.inet6
directly, it should be accessed via tcp_inet6_sk() or inet6_sk().
This happened when we added the first u64 field in struct tcp_sock.
Fixes: 93a77c11ae79 ("tcp: add tcp_inet6_sk() helper")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Bisected-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/dsa2.c')
0 files changed, 0 insertions, 0 deletions