netdev
[Top] [All Lists]

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

To: Arnaldo Carvalho de Melo <acme@xxxxxxxxxxxxxxxx>
Subject: Re: [RFT] Re: Fw: Nasty Oops in 2.6.0-test6 bind/SO_REUSEADDR
From: "David S. Miller" <davem@xxxxxxxxxx>
Date: Thu, 9 Oct 2003 21:14:37 -0700
Cc: netdev@xxxxxxxxxxx, dmerillat@xxxxxxxxxxx
In-reply-to: <20031010032244.GB8365@xxxxxxxxxxxxxxxx>
References: <20031008133345.49f71991.davem@xxxxxxxxxx> <20031010023644.GA8365@xxxxxxxxxxxxxxxx> <20031010032244.GB8365@xxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
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 ...

<Prev in Thread] Current Thread [Next in Thread>