From: Damien Neil Date: Wed, 1 Nov 2000 23:59:57 +0000 (+0000) Subject: Fix for bug #416: If a server hands dhclient an insanely large X-Git-Tag: V3-BETA-1-PATCH-11~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d01dde768206478cdd86683310997d4a335fc1f0;p=thirdparty%2Fdhcp.git Fix for bug #416: If a server hands dhclient an insanely large lease time, select() can get passed a too-large timeout, causing it to return EINVAL. This fix restricts the select() timeout to one day. --- diff --git a/omapip/dispatch.c b/omapip/dispatch.c index 0a8a01b16..0fd9e9abb 100644 --- a/omapip/dispatch.c +++ b/omapip/dispatch.c @@ -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,