]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Fix for bug #416: If a server hands dhclient an insanely large
authorDamien Neil <source@isc.org>
Wed, 1 Nov 2000 23:59:57 +0000 (23:59 +0000)
committerDamien Neil <source@isc.org>
Wed, 1 Nov 2000 23:59:57 +0000 (23:59 +0000)
lease time, select() can get passed a too-large timeout, causing it
to return EINVAL.  This fix restricts the select() timeout to one day.

omapip/dispatch.c

index 0a8a01b167a2d1b21322d1e99bdb5a00780b5303..0fd9e9abbb3f17b94a0e5c03a7326dd1cbe9036c 100644 (file)
@@ -247,6 +247,13 @@ isc_result_t omapi_one_dispatch (omapi_object_t *wo,
                        to.tv_usec += 1000000;
                        to.tv_sec--;
                }
+
+               /* It is possible for the timeout to get set larger than
+                  the largest time select() is willing to accept.
+                  Restricting the timeout to a maximum of one day should
+                  work around this.  -DPN.  (Ref: Bug #416) */
+               if (to.tv_sec > (60 * 60 * 24))
+                       to.tv_sec = 60 * 60 * 24;
        }
        
        /* If the object we're waiting on has reached completion,