Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223222
b: refs/heads/master
c: f198725
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Dec 8, 2010
1 parent a6520d2 commit f4d728a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ad9f4f50fe9288bbe65b7dfd76d8820afac6a24c
refs/heads/master: f19872575ff7819a3723154657a497d9bca66b33
27 changes: 15 additions & 12 deletions trunk/net/ipv4/tcp_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,27 +385,30 @@ struct tcp_out_options {
*/
static u8 tcp_cookie_size_check(u8 desired)
{
if (desired > 0) {
int cookie_size;

if (desired > 0)
/* previously specified */
return desired;
}
if (sysctl_tcp_cookie_size <= 0) {

cookie_size = ACCESS_ONCE(sysctl_tcp_cookie_size);
if (cookie_size <= 0)
/* no default specified */
return 0;
}
if (sysctl_tcp_cookie_size <= TCP_COOKIE_MIN) {

if (cookie_size <= TCP_COOKIE_MIN)
/* value too small, specify minimum */
return TCP_COOKIE_MIN;
}
if (sysctl_tcp_cookie_size >= TCP_COOKIE_MAX) {

if (cookie_size >= TCP_COOKIE_MAX)
/* value too large, specify maximum */
return TCP_COOKIE_MAX;
}
if (0x1 & sysctl_tcp_cookie_size) {

if (cookie_size & 1)
/* 8-bit multiple, illegal, fix it */
return (u8)(sysctl_tcp_cookie_size + 0x1);
}
return (u8)sysctl_tcp_cookie_size;
cookie_size++;

return (u8)cookie_size;
}

/* Write previously computed TCP options to the packet.
Expand Down

0 comments on commit f4d728a

Please sign in to comment.