Skip to contentSkip to conversation

merge raw6_opt with raw6_sock

IPV6 Arnaldo Carvalho de Melo 3 participants 3 messages Jan 18, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi David,

This finishes the inet protos part, now to the legacy protocols.

Available at the usual place:

bk://kernel.bkbits.net/acme/connection_sock-2.6

Regards,

- Arnaldo

===================================================================

[email protected], 2005-01-15 19:24:18-02:00, [email protected]
[IPV6] merge raw6_sock with raw6_opt

No need for two structs, follow the new inet_sock layout style.

 include/linux/ipv6.h |   23 +++++++++++------------
 net/ipv6/raw.c       |   41 +++++++++++++++++++++--------------------
 2 files changed, 32 insertions(+), 32 deletions(-)
include/linux/ipv6.h +11 -12
diff -Nru a/include/linux/ipv6.h b/include/linux/ipv6.h
@@ -247,27 +247,26 @@
 	} cork;
 };
 
-struct raw6_opt {
+/* WARNING: don't change the layout of the members in {raw,udp,tcp}6_sock! */
+struct raw6_sock {
+	/* inet_sock has to be the first member of raw6_sock */
+	struct inet_sock	inet;
 	__u32			checksum;	/* perform checksum */
 	__u32			offset;		/* checksum offset  */
-
 	struct icmp6_filter	filter;
-};
-
-/* WARNING: don't change the layout of the members in {raw,udp,tcp}6_sock! */
-struct raw6_sock {
-	struct inet_sock  inet;
-	struct raw6_opt   raw6;
-	struct ipv6_pinfo inet6;
+	/* ipv6_pinfo has to be the last member of raw6_sock, see inet6_sk_generic */
+	struct ipv6_pinfo	inet6;
 };
 
 struct udp6_sock {
 	struct udp_sock	  udp;
+	/* ipv6_pinfo has to be the last member of udp6_sock, see inet6_sk_generic */
 	struct ipv6_pinfo inet6;
 };
 
 struct tcp6_sock {
 	struct tcp_sock	  tcp;
+	/* ipv6_pinfo has to be the last member of tcp6_sock, see inet6_sk_generic */
 	struct ipv6_pinfo inet6;
 };
 
@@ -277,9 +276,9 @@
 	return inet_sk(__sk)->pinet6;
 }
 
-static inline struct raw6_opt * raw6_sk(const struct sock *__sk)
+static inline struct raw6_sock *raw6_sk(const struct sock *sk)
 {
-	return &((struct raw6_sock *)__sk)->raw6;
+	return (struct raw6_sock *)sk;
 }
 
 static inline void inet_sk_copy_descendant(struct sock *sk_to,
@@ -304,7 +303,7 @@
 	return NULL;
 }
 
-static inline struct raw6_opt * raw6_sk(const struct sock *__sk)
+static inline struct raw6_sock *raw6_sk(const struct sock *sk)
 {
 	return NULL;
 }
net/ipv6/raw.c +21 -20

123 lines not on this page · raw message

maintainer
#2 lore raw
In reply to Arnaldo Carvalho de Melo
Quoted 5 lines · On Mon, 17 Jan 2005 23:30:32 -0200 Arnaldo Carvalho de Melo…

This finishes the inet protos part, now to the legacy protocols.

Available at the usual place:

bk://kernel.bkbits.net/acme/connection_sock-2.6

Pulled, thanks Arnaldo.