diff options
author | Florian Westphal <fw@strlen.de> | 2010-06-16 17:42:15 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-16 17:42:15 -0400 |
commit | 8c76368174ed2359739f1b7b8a9c042b1ef839c4 (patch) | |
tree | 143aa28c9438b24154bc3d1e36b432a534eca50c /net/ipv6/syncookies.c | |
parent | 317fe0e6c5dc9448bcef41a2e31fecfd3dba7f55 (diff) |
syncookies: check decoded options against sysctl settings
Discard the ACK if we find options that do not match current sysctl
settings.
Previously it was possible to create a connection with sack, wscale,
etc. enabled even if the feature was disabled via sysctl.
Also remove an unneeded call to tcp_sack_reset() in
cookie_check_timestamp: Both call sites (cookie_v4_check,
cookie_v6_check) zero "struct tcp_options_received", hand it to
tcp_parse_options() (which does not change tcp_opt->num_sacks/dsack)
and then call cookie_check_timestamp().
Even if num_sacks/dsacks were changed, the structure is allocated on
the stack and after cookie_check_timestamp returns only a few selected
members are copied to the inet_request_sock.
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/syncookies.c')
-rw-r--r-- | net/ipv6/syncookies.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c index 70d330f8c990..c7ee57421ece 100644 --- a/net/ipv6/syncookies.c +++ b/net/ipv6/syncookies.c | |||
@@ -180,8 +180,8 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) | |||
180 | memset(&tcp_opt, 0, sizeof(tcp_opt)); | 180 | memset(&tcp_opt, 0, sizeof(tcp_opt)); |
181 | tcp_parse_options(skb, &tcp_opt, &hash_location, 0); | 181 | tcp_parse_options(skb, &tcp_opt, &hash_location, 0); |
182 | 182 | ||
183 | if (tcp_opt.saw_tstamp) | 183 | if (!cookie_check_timestamp(&tcp_opt)) |
184 | cookie_check_timestamp(&tcp_opt); | 184 | goto out; |
185 | 185 | ||
186 | ret = NULL; | 186 | ret = NULL; |
187 | req = inet6_reqsk_alloc(&tcp6_request_sock_ops); | 187 | req = inet6_reqsk_alloc(&tcp6_request_sock_ops); |