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:
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to