aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/syncookies.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2013-04-20 12:16:44 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2013-04-20 12:16:44 -0400
commitf53f292eeaa234615c31a1306babe703fc4263f2 (patch)
tree707b0933a20f7dc05495e974243a23b5c9f8c918 /net/ipv4/syncookies.c
parent15b9c359f288b09003cb70f7ed204affc0c6614d (diff)
parenta9499fa7cd3fd4824a7202d00c766b269fa3bda6 (diff)
Merge remote-tracking branch 'efi/chainsaw' into x86/efi
Resolved Conflicts: drivers/firmware/efivars.c fs/efivarsfs/file.c Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'net/ipv4/syncookies.c')
-rw-r--r--net/ipv4/syncookies.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index b236ef04914f..ef54377fb11c 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -232,7 +232,8 @@ static inline struct sock *get_cookie_sock(struct sock *sk, struct sk_buff *skb,
232 * 232 *
233 * return false if we decode an option that should not be. 233 * return false if we decode an option that should not be.
234 */ 234 */
235bool cookie_check_timestamp(struct tcp_options_received *tcp_opt, bool *ecn_ok) 235bool cookie_check_timestamp(struct tcp_options_received *tcp_opt,
236 struct net *net, bool *ecn_ok)
236{ 237{
237 /* echoed timestamp, lowest bits contain options */ 238 /* echoed timestamp, lowest bits contain options */
238 u32 options = tcp_opt->rcv_tsecr & TSMASK; 239 u32 options = tcp_opt->rcv_tsecr & TSMASK;
@@ -247,7 +248,7 @@ bool cookie_check_timestamp(struct tcp_options_received *tcp_opt, bool *ecn_ok)
247 248
248 tcp_opt->sack_ok = (options & (1 << 4)) ? TCP_SACK_SEEN : 0; 249 tcp_opt->sack_ok = (options & (1 << 4)) ? TCP_SACK_SEEN : 0;
249 *ecn_ok = (options >> 5) & 1; 250 *ecn_ok = (options >> 5) & 1;
250 if (*ecn_ok && !sysctl_tcp_ecn) 251 if (*ecn_ok && !net->ipv4.sysctl_tcp_ecn)
251 return false; 252 return false;
252 253
253 if (tcp_opt->sack_ok && !sysctl_tcp_sack) 254 if (tcp_opt->sack_ok && !sysctl_tcp_sack)
@@ -295,7 +296,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
295 memset(&tcp_opt, 0, sizeof(tcp_opt)); 296 memset(&tcp_opt, 0, sizeof(tcp_opt));
296 tcp_parse_options(skb, &tcp_opt, &hash_location, 0, NULL); 297 tcp_parse_options(skb, &tcp_opt, &hash_location, 0, NULL);
297 298
298 if (!cookie_check_timestamp(&tcp_opt, &ecn_ok)) 299 if (!cookie_check_timestamp(&tcp_opt, sock_net(sk), &ecn_ok))
299 goto out; 300 goto out;
300 301
301 ret = NULL; 302 ret = NULL;