netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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: Thu, 26 Sep 2002 23:33:10 -0700	[thread overview]
Message-ID: <3D93FBA6.6080905@candelatech.com> (raw)
In-Reply-To: 200209270100.FAA19447@sex.inr.ac.ru

kuznet@ms2.inr.ac.ru wrote:
> Hello!

>>+#ifdef CONFIG_NET_SENDTOSELF
>>+	if (ip_route_output(&rt, daddr, rt->rt_spec_dst, RT_TOS(skb->nh.iph->tos), sk->bound_dev_if))
>>+#else
>>  	if (ip_route_output(&rt, daddr, rt->rt_spec_dst, RT_TOS(skb->nh.iph->tos), 0))
>>+#endif
> 
> 
> This chunk is noop, sk here is a dummy socket internal to kernel,
> where sk->bound_dev_if is identical zero. Grep code to see
> what it is used for.

Ok, I took out my changes above and sure enough, it still seems to work.

I have a question though:  If this method is ever called to send an RST,
will it work?  It seems to me that it may not be routed correctly, but
I don't understand all the circumstances that would cause this method to
be called either...

> 
> The same ("noopness") is true about 90% of the patch. F.e. all the messing
> inside tcp with openreqs is noop.

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 could hash
to the same thing, and so greatly confused themselves.  For instance,

src=1.2.3.4, port 9999, dst=1.2.3.5 port 9999

I believe I was seeing the first packet (SYN) from the originator being
delivered back to the socket that sent the SYN because no new socket on
the receiving side was created because the hash found one (it found the
sending one, unfortunately).


+        /* Will only take netdevice_id into the equation if neither are
+         * 0.  This should be backwards compatible with older code, and also
+         * let us connect to ourselves over external ports.  Otherwise, we
+         * get confused about which connection is the originator v/s the
+         * receiver of the open request. --Ben
+         */
  	for (prev = &lopt->syn_table[tcp_v4_synq_hash(raddr, rport)];
  	     (req = *prev) != NULL;
  	     prev = &req->dl_next) {
  		if (req->rmt_port == rport &&
  		    req->af.v4_req.rmt_addr == raddr &&
  		    req->af.v4_req.loc_addr == laddr &&
-		    TCP_INET_FAMILY(req->class->family)) {
+		    TCP_INET_FAMILY(req->class->family)
+#ifdef CONFIG_NET_SENDTOSELF
+                    && ((!netdevice_id) || (!req->bound_dev_if) ||
+                     (req->bound_dev_if == netdevice_id))) {
+#else
+                   ) {
+#endif


Thanks again,
Ben

-- 
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

  parent reply	other threads:[~2002-09-27  6:33 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 [this message]
2002-09-27 15:01                   ` kuznet
2002-09-27 15:40                     ` Ben Greear
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=3D93FBA6.6080905@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).