From: Ben Greear <greearb@candelatech.com>
To: kuznet@ms2.inr.ac.ru
Cc: netdev@oss.sgi.com
Subject: Re: [PATCH] Networking: send-to-self [link to non-broken patch this
Date: Fri, 27 Sep 2002 08:40:11 -0700 [thread overview]
Message-ID: <3D947BDB.2010007@candelatech.com> (raw)
In-Reply-To: 200209271501.TAA21079@sex.inr.ac.ru
kuznet@ms2.inr.ac.ru wrote:
> Hello!
>
>
>>I have a question though: If this method is ever called to send an RST,
>>will it work?
>
>
> Work for what? This method is used when you have no socket in the system
> matching to this skb. :-)
>
>
>>What about this part, do you think it is not needed either? It appeared
>>to me that w/out this, the sending socket and the receiving socket
>
> ...
>
>>sending one, unfortunately).
>
>
> No, this is impossible. addrs/ports identity identifies socket unambiguously.
Assume we are sending to ourself, and we bind to the local ip/port before we connect:
we have source IP = 1.2.3.4, source-port = 7
Assume we are connecting to a socket on a second interface, with dest ip = 1.2.3.5,
dest-port = 7
When the SYN is received on the second port after connect() is called, the code
looks for a socket based on source ip 1.2.3.4 and source port 7. In this case, it should
not find any socket because this SYN is the first communication....
However, because the sender is on the same machine, using the same kernel
structures, the socket **DOES** exist, and so the hash lookup finds it. At
this point, I believe it sends the RST because a socket in the SYN-sent state
just received a SYN packet, which is not how things should work.
>
> But even this does not matter, your patch is noop by much simpler pure
> "syntactical" reason, it copies req->bound_dev_if from listening socket.
> And after this the check in lookup req degenerates to TRUE __identitically__.
> :-)
It will not match the case where the sending socket is bound to interface 3
and the listening socket is bound on interface 4, but both sockets have the
same source IP and port. That was what I was trying
to do...but I may have not done it quite right :)
Thanks,
Ben
>
> Alexey
>
--
Ben Greear <greearb@candelatech.com> <Ben_Greear AT excite.com>
President of Candela Technologies Inc http://www.candelatech.com
ScryMUD: http://scry.wanfear.com http://scry.wanfear.com/~greear
next prev parent reply other threads:[~2002-09-27 15:40 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-18 6:47 [PATCH] Networking: send-to-self Ben Greear
2002-09-18 6:44 ` David S. Miller
2002-09-18 6:53 ` Ben Greear
2002-09-18 7:09 ` [PATCH] Networking: send-to-self [link to non-broken patch this time] Ben Greear
2002-09-18 22:55 ` David S. Miller
2002-09-18 23:20 ` Ben Greear
2002-09-19 1:28 ` David S. Miller
2002-09-19 2:07 ` Ben Greear
2002-09-19 2:01 ` David S. Miller
2002-09-19 3:04 ` Ben Greear
2002-09-27 1:00 ` [PATCH] Networking: send-to-self [link to non-broken patch this kuznet
2002-09-27 1:30 ` Ben Greear
2002-09-27 3:36 ` kuznet
2002-09-27 6:33 ` Ben Greear
2002-09-27 15:01 ` kuznet
2002-09-27 15:40 ` Ben Greear [this message]
2002-09-27 15:46 ` kuznet
2002-09-27 15:53 ` Ben Greear
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=3D947BDB.2010007@candelatech.com \
--to=greearb@candelatech.com \
--cc=kuznet@ms2.inr.ac.ru \
--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).