Subject: Re: [net-next-2.6 PATCH 1/4] TCPCT part 1: initial SYN exchange with SYNACK data

From: William Allen Simpson <[email-masked]>
Date: Thu, 15 Oct 2009 12:29:56 -0400

William Allen Simpson wrote:
> #3 It's not possible to wrap and extend request_sock, as that is already
> done by IPv6 and others, causing a conflict.  That was suggested by
> another maintainer, and I drafted some code last week, but wasn't able to
> figure out a non-conflicting code path.
> 
After private discussion with others, I'm proposing a wrapper over a union
of those other header files, that would ensure new fields would be beyond
the previous extensions.  It would have to be in its own .h file, and
would have the unfortunate side effect of hauling in other protocols, but
only into a very few net/ipv4/tcp*.c files.

The only advantage is that it doesn't matter how big this request_sock
will become, as it is thrown away immediately after use (just like stack
parameters in the previous proposal).  Fourth time's the charm?

That is, something like:

#include <linux/ipv6.h>
#include <net/dccp/ipv6.h>

struct extend_request_sock {
	union {
		/* the biggest known */
		struct tcp6_request_sock tcp6rsk;
		struct dccp6_request_sock dccp6rsk;
	} wrap;

	u8	cookie_bakery[TCP_COOKIE_MAX];
	u8	cookie_plus;
	u8	cookie_in_always:1,
		cookie_out_never:1;
}