From dfdae3a1fb466b4145e053460a99dcd13abe115d Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Mon, 10 Jan 2005 22:47:15 -0200 Subject: [UDP] merge udp_sock with udp_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/udp.h | 22 +++++++++------------- 2 files changed, 10 insertions(+), 15 deletions(-) (limited to 'include/linux') diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 9d2999715321..f80c4b3f84a3 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h @@ -262,8 +262,7 @@ struct raw6_sock { }; struct udp6_sock { - struct inet_sock inet; - struct udp_opt udp; + struct udp_sock udp; struct ipv6_pinfo inet6; }; diff --git a/include/linux/udp.h b/include/linux/udp.h index 831a3f532a10..b60e0b4a25c4 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h @@ -40,26 +40,22 @@ struct udphdr { #include #include -struct udp_opt { - int pending; /* Any pending frames ? */ - unsigned int corkflag; /* Cork is required */ - __u16 encap_type; /* Is this an Encapsulation socket? */ +struct udp_sock { + /* inet_sock has to be the first member */ + struct inet_sock inet; + int pending; /* Any pending frames ? */ + unsigned int corkflag; /* Cork is required */ + __u16 encap_type; /* Is this an Encapsulation socket? */ /* * Following member retains the infomation to create a UDP header * when the socket is uncorked. */ - __u16 len; /* total length of pending frames */ -}; - -/* WARNING: don't change the layout of the members in udp_sock! */ -struct udp_sock { - struct inet_sock inet; - struct udp_opt udp; + __u16 len; /* total length of pending frames */ }; -static inline struct udp_opt * udp_sk(const struct sock *__sk) +static inline struct udp_sock *udp_sk(const struct sock *sk) { - return &((struct udp_sock *)__sk)->udp; + return (struct udp_sock *)sk; } #endif -- cgit v1.2.3