From: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
To: "David S. Miller" <davem@redhat.com>
Cc: netdev@oss.sgi.com, dmerillat@sequiam.com
Subject: Re: [RFT] Re: Fw: Nasty Oops in 2.6.0-test6 bind/SO_REUSEADDR
Date: Fri, 10 Oct 2003 12:40:52 -0300 [thread overview]
Message-ID: <20031010154052.GA11366@conectiva.com.br> (raw)
In-Reply-To: <20031009211437.2cf87a4f.davem@redhat.com>
Em Thu, Oct 09, 2003 at 09:14:37PM -0700, David S. Miller escreveu:
>
> 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 ...
Gotcha, I'm working on this now, creating inet_rcv_saddr and inet6_rcv_saddr
inline functions, and in the process I'm finding what seems like a bug in
ipv6_rcv_saddr_equal, look at this:
if (sk2->sk_family == AF_INET6 &&
!ipv6_addr_cmp(&np->rcv_saddr,
(sk2->sk_state != TCP_TIME_WAIT ?
&inet6_sk(sk2)->rcv_saddr :
&tcptw_sk(sk)->tw_v6_rcv_saddr)))
^^
^^
shouldn't the tcp_tw_sk(sk) be tcp_tw_sk(sk2)?
And in this function we have the guard against it being a tcp_tw_bucket, but
not in all places...
Anyway, I'll be posting patches today.
- Arnaldo
next prev parent reply other threads:[~2003-10-10 15:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-08 20:33 Fw: Nasty Oops in 2.6.0-test6 bind/SO_REUSEADDR David S. Miller
2003-10-09 17:03 ` Dan Merillat
2003-10-10 2:36 ` Arnaldo Carvalho de Melo
2003-10-10 3:22 ` [RFT] " Arnaldo Carvalho de Melo
2003-10-10 4:14 ` David S. Miller
2003-10-10 15:40 ` Arnaldo Carvalho de Melo [this message]
2003-10-11 19:56 ` David S. Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20031010154052.GA11366@conectiva.com.br \
--to=acme@conectiva.com.br \
--cc=davem@redhat.com \
--cc=dmerillat@sequiam.com \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).