Patch from the ISC DHCP CVS repository, fix dhclient problem,

"Re: dhclient still taking up 95% of CPU" in current-users:

: 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.
This commit is contained in:
taca 2000-11-02 03:14:21 +00:00
parent e3e05b89d4
commit 6a3b366a8c
1 changed files with 7 additions and 0 deletions

View File

@ -247,6 +247,13 @@ isc_result_t omapi_one_dispatch (omapi_object_t *wo,
to.tv_usec += 1000000; to.tv_usec += 1000000;
to.tv_sec--; 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, /* If the object we're waiting on has reached completion,