aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_ipv4.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2010-06-21 07:48:45 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-27 01:00:03 -0400
commit172d69e63c7f1e8300d0e1c1bbd8eb0f630faa15 (patch)
treec71118ddc86186e235a920b9529c457db5e9aae5 /net/ipv4/tcp_ipv4.c
parent734f614bc1e7c6bf075d201f6bd9a555b8b4a984 (diff)
syncookies: add support for ECN
Allows use of ECN when syncookies are in effect by encoding ecn_ok into the syn-ack tcp timestamp. While at it, remove a uneeded #ifdef CONFIG_SYN_COOKIES. With CONFIG_SYN_COOKIES=nm want_cookie is ifdef'd to 0 and gcc removes the "if (0)". Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r--net/ipv4/tcp_ipv4.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 2e41e6f92968..8fa32f5ae2ce 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1328,14 +1328,12 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
1328 if (security_inet_conn_request(sk, skb, req)) 1328 if (security_inet_conn_request(sk, skb, req))
1329 goto drop_and_free; 1329 goto drop_and_free;
1330 1330
1331 if (!want_cookie) 1331 if (!want_cookie || tmp_opt.tstamp_ok)
1332 TCP_ECN_create_request(req, tcp_hdr(skb)); 1332 TCP_ECN_create_request(req, tcp_hdr(skb));
1333 1333
1334 if (want_cookie) { 1334 if (want_cookie) {
1335#ifdef CONFIG_SYN_COOKIES
1336 req->cookie_ts = tmp_opt.tstamp_ok;
1337#endif
1338 isn = cookie_v4_init_sequence(sk, skb, &req->mss); 1335 isn = cookie_v4_init_sequence(sk, skb, &req->mss);
1336 req->cookie_ts = tmp_opt.tstamp_ok;
1339 } else if (!isn) { 1337 } else if (!isn) {
1340 struct inet_peer *peer = NULL; 1338 struct inet_peer *peer = NULL;
1341 1339