netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch] Establishing more than 64K outgoing TCP connections
@ 2008-10-28 21:06 Yavor Goulishev
  2008-11-02  4:15 ` David Miller
  0 siblings, 1 reply; 18+ messages in thread
From: Yavor Goulishev @ 2008-10-28 21:06 UTC (permalink / raw)
  To: netdev@vger.kernel.org; +Cc: David Miller

Hi guys,
I'm sending you a tiny patch for the kernel.
The change allowed me to establish more than 64K outgoing TCP connections from a single Linux box.
Being able to use multihomed client box to load test a server reduced dramatically the number of physical boxes I needed.
The other way to go was virtual machines, but you can't beat the simplicity of the single multihomed client.
Also the patch fixes an important symmetry.
Using the multihome setup is a simple technique to overcome the 64K limit on the server side.
The patch makes it possible on the client side too.

The fix is only for TCP but probably the same issue exists for UDP.
I didn't had the time to investigate.

The patch is against the latest code base 2.6.28-rc2.

--Yavor

diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index bd1278a..d72fba6 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -109,7 +109,9 @@ int inet_csk_get_port(struct sock *sk, unsigned short snum)
                                        hashinfo->bhash_size)];
                        spin_lock(&head->lock);
                        inet_bind_bucket_for_each(tb, node, &head->chain)
-                               if (tb->ib_net == net && tb->port == rover)
+                               if (tb->ib_net == net &&
+                                   tb->port == rover &&
+                                   inet_csk(sk)->icsk_af_ops->bind_conflict(sk, tb))
                                        goto next;
                        break;
                next:

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2008-11-07 23:04 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-28 21:06 [Patch] Establishing more than 64K outgoing TCP connections Yavor Goulishev
2008-11-02  4:15 ` David Miller
2008-11-07  6:12   ` Yavor Goulishev
2008-11-07  6:23     ` David Miller
2008-11-07  6:57       ` Yavor Goulishev
2008-11-07  7:04         ` David Miller
2008-11-07  7:15           ` Yavor Goulishev
2008-11-07  7:30             ` David Miller
2008-11-07  7:40               ` Yavor Goulishev
2008-11-07  8:45         ` Evgeniy Polyakov
2008-11-07 16:38           ` Yavor Goulishev
2008-11-07 17:25             ` Evgeniy Polyakov
2008-11-07 19:54             ` David Miller
2008-11-07 22:37               ` Yavor Goulishev
2008-11-07 23:04                 ` Evgeniy Polyakov
2008-11-07  8:36   ` Rémi Denis-Courmont
2008-11-07 15:56     ` Yavor Goulishev
2008-11-07 16:23       ` Eric Dumazet

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