* [gentoo-commits] linux-patches r1364 - genpatches-2.6/trunk/2.6.27
@ 2008-10-29 15:59 Mike Pagano (mpagano)
0 siblings, 0 replies; only message in thread
From: Mike Pagano (mpagano) @ 2008-10-29 15:59 UTC (permalink / raw
To: gentoo-commits
Author: mpagano
Date: 2008-10-29 15:59:11 +0000 (Wed, 29 Oct 2008)
New Revision: 1364
Added:
genpatches-2.6/trunk/2.6.27/2000_tcp-option-ordering-restore.patch
Modified:
genpatches-2.6/trunk/2.6.27/0000_README
Log:
Adding patch to restore ordering of TCP options for the sake of inter-operability
Modified: genpatches-2.6/trunk/2.6.27/0000_README
===================================================================
--- genpatches-2.6/trunk/2.6.27/0000_README 2008-10-28 00:43:27 UTC (rev 1363)
+++ genpatches-2.6/trunk/2.6.27/0000_README 2008-10-29 15:59:11 UTC (rev 1364)
@@ -55,6 +55,10 @@
From: http://www.kernel.org
Desc: Linux 2.6.27.4
+Patch: 2000_tcp-option-ordering-restore.patch
+From: http://bugs.gentoo.org/show_bug.cgi?id=242634
+Desc: Restore ordering of TCP options for the sake of inter-operability
+
Patch: 4100_dm-bbr.patch
From: EVMS 2.5.2
Desc: Bad block relocation support for LiveCD users
Added: genpatches-2.6/trunk/2.6.27/2000_tcp-option-ordering-restore.patch
===================================================================
--- genpatches-2.6/trunk/2.6.27/2000_tcp-option-ordering-restore.patch (rev 0)
+++ genpatches-2.6/trunk/2.6.27/2000_tcp-option-ordering-restore.patch 2008-10-29 15:59:11 UTC (rev 1364)
@@ -0,0 +1,81 @@
+From: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
+Date: Thu, 23 Oct 2008 21:06:35 +0000 (-0700)
+Subject: tcp: Restore ordering of TCP options for the sake of inter-operability
+X-Git-Tag: v2.6.28-rc1~3^2
+X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=fd6149d332973bafa50f03ddb0ea9513e67f4517
+
+tcp: Restore ordering of TCP options for the sake of inter-operability
+
+This is not our bug! Sadly some devices cannot cope with the change
+of TCP option ordering which was a result of the recent rewrite of
+the option code (not that there was some particular reason steming
+from the rewrite for the reordering) though any ordering of TCP
+options is perfectly legal. Thus we restore the original ordering
+to allow interoperability with/through such broken devices and add
+some warning about this trap. Since the reordering just happened
+without any particular reason, this change shouldn't cost us
+anything.
+
+There are already couple of known failure reports (within close
+proximity of the last release), so the problem might be more
+wide-spread than a single device. And other reports which may
+be due to the same problem though the symptoms were less obvious.
+Analysis of one of the case revealed (with very high probability)
+that sack capability cannot be negotiated as the first option
+(SYN never got a response).
+
+Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
+Reported-by: Aldo Maggi <sentiniate@tiscali.it>
+Tested-by: Aldo Maggi <sentiniate@tiscali.it>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+
+diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
+index de54f02..e4c5ac9 100644
+--- a/net/ipv4/tcp_output.c
++++ b/net/ipv4/tcp_output.c
+@@ -362,6 +362,17 @@ struct tcp_out_options {
+ __u32 tsval, tsecr; /* need to include OPTION_TS */
+ };
+
++/* Beware: Something in the Internet is very sensitive to the ordering of
++ * TCP options, we learned this through the hard way, so be careful here.
++ * Luckily we can at least blame others for their non-compliance but from
++ * inter-operatibility perspective it seems that we're somewhat stuck with
++ * the ordering which we have been using if we want to keep working with
++ * those broken things (not that it currently hurts anybody as there isn't
++ * particular reason why the ordering would need to be changed).
++ *
++ * At least SACK_PERM as the first option is known to lead to a disaster
++ * (but it may well be that other scenarios fail similarly).
++ */
+ static void tcp_options_write(__be32 *ptr, struct tcp_sock *tp,
+ const struct tcp_out_options *opts,
+ __u8 **md5_hash) {
+@@ -376,6 +387,12 @@ static void tcp_options_write(__be32 *ptr, struct tcp_sock *tp,
+ *md5_hash = NULL;
+ }
+
++ if (unlikely(opts->mss)) {
++ *ptr++ = htonl((TCPOPT_MSS << 24) |
++ (TCPOLEN_MSS << 16) |
++ opts->mss);
++ }
++
+ if (likely(OPTION_TS & opts->options)) {
+ if (unlikely(OPTION_SACK_ADVERTISE & opts->options)) {
+ *ptr++ = htonl((TCPOPT_SACK_PERM << 24) |
+@@ -392,12 +409,6 @@ static void tcp_options_write(__be32 *ptr, struct tcp_sock *tp,
+ *ptr++ = htonl(opts->tsecr);
+ }
+
+- if (unlikely(opts->mss)) {
+- *ptr++ = htonl((TCPOPT_MSS << 24) |
+- (TCPOLEN_MSS << 16) |
+- opts->mss);
+- }
+-
+ if (unlikely(OPTION_SACK_ADVERTISE & opts->options &&
+ !(OPTION_TS & opts->options))) {
+ *ptr++ = htonl((TCPOPT_NOP << 24) |
+
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-10-29 15:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-29 15:59 [gentoo-commits] linux-patches r1364 - genpatches-2.6/trunk/2.6.27 Mike Pagano (mpagano)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox