mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
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>
This commit is contained in:
parent
734f614bc1
commit
172d69e63c
5 changed files with 17 additions and 13 deletions
|
@ -1328,14 +1328,12 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
|
|||
if (security_inet_conn_request(sk, skb, req))
|
||||
goto drop_and_free;
|
||||
|
||||
if (!want_cookie)
|
||||
if (!want_cookie || tmp_opt.tstamp_ok)
|
||||
TCP_ECN_create_request(req, tcp_hdr(skb));
|
||||
|
||||
if (want_cookie) {
|
||||
#ifdef CONFIG_SYN_COOKIES
|
||||
req->cookie_ts = tmp_opt.tstamp_ok;
|
||||
#endif
|
||||
isn = cookie_v4_init_sequence(sk, skb, &req->mss);
|
||||
req->cookie_ts = tmp_opt.tstamp_ok;
|
||||
} else if (!isn) {
|
||||
struct inet_peer *peer = NULL;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue