public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Julian Anastasov <ja@ssi.bg>
Cc: "Yurij M. Plotnikov" <Yurij.Plotnikov@oktetlabs.ru>,
	David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org
Subject: Re: Connect hangs for a while before returns -1 with ECONNREFUSED on 3.2 for loopback
Date: Sat, 04 Feb 2012 17:58:35 +0100	[thread overview]
Message-ID: <1328374715.2731.21.camel@edumazet-laptop> (raw)
In-Reply-To: <alpine.LFD.2.00.1202041537370.1496@ja.ssi.bg>

Le samedi 04 février 2012 à 17:48 +0200, Julian Anastasov a écrit :

> 	flowi4_tos is missing from this list but anyways,
> it looks wrong because __ip_route_output_key returns data
> in saddr and daddr, such change will break source address
> autoselection and destination address autoselection. That is
> what ip_route_connect is trying to do. May be
> ip_route_connect should be fixed instead?
> 

Thanks Julian, this is indeed tricky.

I tested successfully the following patch, maybe we also need
to restore tos bits ?

diff --git a/include/net/route.h b/include/net/route.h
index 91855d1..f27a82d 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -272,7 +272,9 @@ static inline struct rtable *ip_route_connect(struct flowi4 *fl4,
 		ip_rt_put(rt);
 	}
 	security_sk_classify_flow(sk, flowi4_to_flowi(fl4));
-	return ip_route_output_flow(net, fl4, sk);
+	rt = ip_route_output_flow(net, fl4, sk);
+	fl4->flowi4_oif = oif;
+	return rt;
 }
 
 static inline struct rtable *ip_route_newports(struct flowi4 *fl4, struct rtable *rt,

  reply	other threads:[~2012-02-04 16:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-03  6:25 Connect hangs for a while before returns -1 with ECONNREFUSED on 3.2 for loopback Yurij M. Plotnikov
2012-02-03 14:38 ` Eric Dumazet
2012-02-03 15:15   ` Eric Dumazet
2012-02-04 12:26     ` Eric Dumazet
2012-02-04 15:48       ` Julian Anastasov
2012-02-04 16:58         ` Eric Dumazet [this message]
2012-02-04 17:39           ` Julian Anastasov
2012-02-04 19:43             ` Eric Dumazet
2012-02-04 20:51               ` Julian Anastasov
2012-02-04 21:26                 ` Eric Dumazet
2012-02-04 20:39       ` David 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=1328374715.2731.21.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=Yurij.Plotnikov@oktetlabs.ru \
    --cc=davem@davemloft.net \
    --cc=ja@ssi.bg \
    --cc=netdev@vger.kernel.org \
    /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