svn commit: r255030 - head/sys/kern

John Baldwin jhb at FreeBSD.org
Thu Aug 29 15:59:06 UTC 2013


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:


More information about the svn-src-head mailing list