Subject: Re: [RFT] Re: Fw: Nasty Oops in 2.6.0-test6 bind/SO_REUSEADDR

From: "David S. Miller" <[email-masked]>
Date: Thu, 9 Oct 2003 21:14:37 -0700

Even if they make the OOPS go away, all of these patches are
not correct.

You have to consider the timewait sockets just like established
sockets in the bind conflict test.

Therefore in the most inner part of this chain of if's you need
to have something like:

	u32 rcv_saddr;

	if (sk->sk_state == TCP_TIME_WAIT) {
		struct tcp_tw_bucket *tw = tcptw_sk(sk2);
		rcv_saddr = tw->tw_rcv_saddr;
	} else {
		struct inet_sock *inet = inet_sk(sk2);
		rcv_saddr = inet->rcv_saddr;
	}
	if (!rcv_saddr || !sk->rcv_saddr ||
	    sk->rcv_saddr == rcv_saddr)
		... blah blah blah ...