mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-14 15:54:15 +08:00
f5f80e32de
IPv6 inet sockets are supposed to have a "struct ipv6_pinfo"
field at the end of their definition, so that inet6_sk_generic()
can derive from socket size the offset of the "struct ipv6_pinfo".
This is very fragile, and prevents adding bigger alignment
in sockets, because inet6_sk_generic() does not work
if the compiler adds padding after the ipv6_pinfo component.
We are currently working on a patch series to reorganize
TCP structures for better data locality and found issues
similar to the one fixed in commit f5d547676c
("tcp: fix tcp_inet6_sk() for 32bit kernels")
Alternative would be to force an alignment on "struct ipv6_pinfo",
greater or equal to __alignof__(any ipv6 sock) to ensure there is
no padding. This does not look great.
v2: fix typo in mptcp_proto_v6_init() (Paolo)
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Chao Wu <wwchao@google.com>
Cc: Wei Wang <weiwan@google.com>
Cc: Coco Li <lixiaoyan@google.com>
Cc: YiFei Zhu <zhuyifei@google.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
28 lines
517 B
C
28 lines
517 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
#ifndef _DCCP_IPV6_H
|
|
#define _DCCP_IPV6_H
|
|
/*
|
|
* net/dccp/ipv6.h
|
|
*
|
|
* An implementation of the DCCP protocol
|
|
* Copyright (c) 2005 Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
|
|
*/
|
|
|
|
#include <linux/dccp.h>
|
|
#include <linux/ipv6.h>
|
|
|
|
struct dccp6_sock {
|
|
struct dccp_sock dccp;
|
|
struct ipv6_pinfo inet6;
|
|
};
|
|
|
|
struct dccp6_request_sock {
|
|
struct dccp_request_sock dccp;
|
|
};
|
|
|
|
struct dccp6_timewait_sock {
|
|
struct inet_timewait_sock inet;
|
|
};
|
|
|
|
#endif /* _DCCP_IPV6_H */
|