Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 56992
b: refs/heads/master
c: ba78073
h: refs/heads/master
v: v3
  • Loading branch information
Vasily Averin authored and David S. Miller committed May 24, 2007
1 parent 06608c6 commit b57f100
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 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: c883f215a23a9352097b8d17fb8dae22ff134a14
refs/heads/master: ba78073e6f70cd9c64a478a9bd901d7c8736cfbc
14 changes: 13 additions & 1 deletion trunk/net/core/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,19 @@ static int sock_set_timeout(long *timeo_p, char __user *optval, int optlen)
return -EINVAL;
if (copy_from_user(&tv, optval, sizeof(tv)))
return -EFAULT;

if (tv.tv_usec < 0 || tv.tv_usec >= USEC_PER_SEC)
return -EDOM;

if (tv.tv_sec < 0) {
static int warned = 0;
*timeo_p = 0;
if (warned < 10 && net_ratelimit())
warned++;
printk(KERN_INFO "sock_set_timeout: `%s' (pid %d) "
"tries to set negative timeout\n",
current->comm, current->pid);
return 0;
}
*timeo_p = MAX_SCHEDULE_TIMEOUT;
if (tv.tv_sec == 0 && tv.tv_usec == 0)
return 0;
Expand Down

0 comments on commit b57f100

Please sign in to comment.