From ef4a8922c78eecaad68d507d084de81c82db1d2b Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Tue, 28 Dec 2004 12:22:56 -0200 Subject: [TCP] merge tcp_sock with tcp_opt No need for two structs, follow the new inet_sock layout style. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller --- include/linux/ipv6.h | 3 +-- include/linux/tcp.h | 14 +++++--------- 2 files changed, 6 insertions(+), 11 deletions(-) (limited to 'include/linux') diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index d7c28b9db4fd..0831622c80c0 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h @@ -268,8 +268,7 @@ struct udp6_sock { }; struct tcp6_sock { - struct inet_sock inet; - struct tcp_opt tcp; + struct tcp_sock tcp; struct ipv6_pinfo inet6; }; diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 61de59d3cef4..b8d7df3916a5 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h @@ -214,7 +214,9 @@ enum tcp_congestion_algo { TCP_BIC, }; -struct tcp_opt { +struct tcp_sock { + /* inet_sock has to be the first member of tcp_sock */ + struct inet_sock inet; int tcp_header_len; /* Bytes of tcp header to send */ /* @@ -438,15 +440,9 @@ struct tcp_opt { } bictcp; }; -/* WARNING: don't change the layout of the members in tcp_sock! */ -struct tcp_sock { - struct inet_sock inet; - struct tcp_opt tcp; -}; - -static inline struct tcp_opt * tcp_sk(const struct sock *__sk) +static inline struct tcp_sock *tcp_sk(const struct sock *sk) { - return &((struct tcp_sock *)__sk)->tcp; + return (struct tcp_sock *)sk; } #endif -- cgit v1.2.3