aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/tcp_ipv6.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2008-04-10 06:12:40 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-10 06:12:40 -0400
commit4dfc2817025965a2fc78a18c50f540736a6b5c24 (patch)
treef8f2f76e660d9d5c7a0f39ed8a79cb6d6d181206 /net/ipv6/tcp_ipv6.c
parent15be75cdb5db442d0e33d37b20832b88f3ccd383 (diff)
[Syncookies]: Add support for TCP options via timestamps.
Allow the use of SACK and window scaling when syncookies are used and the client supports tcp timestamps. Options are encoded into the timestamp sent in the syn-ack and restored from the timestamp echo when the ack is received. Based on earlier work by Glenn Griffin. This patch avoids increasing the size of structs by encoding TCP options into the least significant bits of the timestamp and by not using any 'timestamp offset'. The downside is that the timestamp sent in the packet after the synack will increase by several seconds. changes since v1: don't duplicate timestamp echo decoding function, put it into ipv4/syncookie.c and have ipv6/syncookies.c use it. Feedback from Glenn Griffin: fix line indented with spaces, kill redundant if () Reviewed-by: Hagen Paul Pfeifer <hagen@jauu.net> Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r--net/ipv6/tcp_ipv6.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 378cc4002a76..8ebf6de29562 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1290,10 +1290,8 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
1290 1290
1291 tcp_parse_options(skb, &tmp_opt, 0); 1291 tcp_parse_options(skb, &tmp_opt, 0);
1292 1292
1293 if (want_cookie) { 1293 if (want_cookie && !tmp_opt.saw_tstamp)
1294 tcp_clear_options(&tmp_opt); 1294 tcp_clear_options(&tmp_opt);
1295 tmp_opt.saw_tstamp = 0;
1296 }
1297 1295
1298 tmp_opt.tstamp_ok = tmp_opt.saw_tstamp; 1296 tmp_opt.tstamp_ok = tmp_opt.saw_tstamp;
1299 tcp_openreq_init(req, &tmp_opt, skb); 1297 tcp_openreq_init(req, &tmp_opt, skb);
@@ -1307,6 +1305,7 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
1307 1305
1308 if (want_cookie) { 1306 if (want_cookie) {
1309 isn = cookie_v6_init_sequence(sk, skb, &req->mss); 1307 isn = cookie_v6_init_sequence(sk, skb, &req->mss);
1308 req->cookie_ts = tmp_opt.tstamp_ok;
1310 } else if (!isn) { 1309 } else if (!isn) {
1311 if (ipv6_opt_accepted(sk, skb) || 1310 if (ipv6_opt_accepted(sk, skb) ||
1312 np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo || 1311 np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo ||