diff options
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r-- | net/ipv4/tcp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 581ecf02c6b5..e7e6eeae49c0 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -2681,7 +2681,10 @@ static int do_tcp_setsockopt(struct sock *sk, int level, | |||
2681 | /* Cap the max timeout in ms TCP will retry/retrans | 2681 | /* Cap the max timeout in ms TCP will retry/retrans |
2682 | * before giving up and aborting (ETIMEDOUT) a connection. | 2682 | * before giving up and aborting (ETIMEDOUT) a connection. |
2683 | */ | 2683 | */ |
2684 | icsk->icsk_user_timeout = msecs_to_jiffies(val); | 2684 | if (val < 0) |
2685 | err = -EINVAL; | ||
2686 | else | ||
2687 | icsk->icsk_user_timeout = msecs_to_jiffies(val); | ||
2685 | break; | 2688 | break; |
2686 | default: | 2689 | default: |
2687 | err = -ENOPROTOOPT; | 2690 | err = -ENOPROTOOPT; |