Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Aug 2013 15:59:05 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r255030 - head/sys/kern
Message-ID:  <201308291559.r7TFx5r5020197@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Thu Aug 29 15:59:05 2013
New Revision: 255030
URL: http://svnweb.freebsd.org/changeset/base/255030

Log:
  Don't return an error for socket timeouts that are too large.  Just
  cap them to INT_MAX ticks instead.
  
  PR:		kern/181416 (r254699 really)
  Requested by:	bde
  MFC after:	2 weeks

Modified:
  head/sys/kern/uipc_socket.c

Modified: head/sys/kern/uipc_socket.c
==============================================================================
--- head/sys/kern/uipc_socket.c	Thu Aug 29 15:58:20 2013	(r255029)
+++ head/sys/kern/uipc_socket.c	Thu Aug 29 15:59:05 2013	(r255030)
@@ -2698,17 +2698,12 @@ sosetopt(struct socket *so, struct socko
 				    sizeof tv);
 			if (error)
 				goto bad;
-
-			if (tv.tv_sec < 0 || tv.tv_sec > INT_MAX / hz ||
-			    tv.tv_usec < 0 || tv.tv_usec >= 1000000) {
+			if (tv.tv_sec < 0 || tv.tv_usec < 0 ||
+			    tv.tv_usec >= 1000000) {
 				error = EDOM;
 				goto bad;
 			}
 			val = tvtohz(&tv);
-			if (val == INT_MAX) {
-				error = EDOM;
-				goto bad;
-			}
 
 			switch (sopt->sopt_name) {
 			case SO_SNDTIMEO:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308291559.r7TFx5r5020197>