diff options
author | Adam Langley <agl@imperialviolet.org> | 2008-07-19 03:04:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-19 03:04:31 -0400 |
commit | 33ad798c924b4a1afad3593f2796d465040aadd5 (patch) | |
tree | 2a0a868849d6e84591b9d4d917722aee2544b77b /include | |
parent | 49a72dfb8814c2d65bd9f8c9c6daf6395a1ec58d (diff) |
tcp: options clean up
This should fix the following bugs:
* Connections with MD5 signatures produce invalid packets whenever SACK
options are included
* MD5 signatures are counted twice in the MSS calculations
Behaviour changes:
* A SYN with MD5 + SACK + TS elicits a SYNACK with MD5 + SACK
This is because we can't fit any SACK blocks in a packet with MD5 + TS
options. There was discussion about disabling SACK rather than TS in
order to fit in better with old, buggy kernels, but that was deemed to
be unnecessary.
* SYNs with MD5 don't include a TS option
See above.
Additionally, it removes a bunch of duplicated logic for calculating options,
which should help avoid these sort of issues in the future.
Signed-off-by: Adam Langley <agl@imperialviolet.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/tcp.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index 31f5bbfc59bc..8983386356a5 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -50,6 +50,7 @@ extern atomic_t tcp_orphan_count; | |||
50 | extern void tcp_time_wait(struct sock *sk, int state, int timeo); | 50 | extern void tcp_time_wait(struct sock *sk, int state, int timeo); |
51 | 51 | ||
52 | #define MAX_TCP_HEADER (128 + MAX_HEADER) | 52 | #define MAX_TCP_HEADER (128 + MAX_HEADER) |
53 | #define MAX_TCP_OPTION_SPACE 40 | ||
53 | 54 | ||
54 | /* | 55 | /* |
55 | * Never offer a window over 32767 without using window scaling. Some | 56 | * Never offer a window over 32767 without using window scaling. Some |
@@ -184,6 +185,7 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
184 | #define TCPOLEN_SACK_BASE_ALIGNED 4 | 185 | #define TCPOLEN_SACK_BASE_ALIGNED 4 |
185 | #define TCPOLEN_SACK_PERBLOCK 8 | 186 | #define TCPOLEN_SACK_PERBLOCK 8 |
186 | #define TCPOLEN_MD5SIG_ALIGNED 20 | 187 | #define TCPOLEN_MD5SIG_ALIGNED 20 |
188 | #define TCPOLEN_MSS_ALIGNED 4 | ||
187 | 189 | ||
188 | /* Flags in tp->nonagle */ | 190 | /* Flags in tp->nonagle */ |
189 | #define TCP_NAGLE_OFF 1 /* Nagle's algo is disabled */ | 191 | #define TCP_NAGLE_OFF 1 /* Nagle's algo is disabled */ |