Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/usr.sbin/dhcp/omapip Pullup 1.7 [taca]:



details:   https://anonhg.NetBSD.org/src/rev/898c827e6af4
branches:  netbsd-1-5
changeset: 490103:898c827e6af4
user:      tv <tv%NetBSD.org@localhost>
date:      Fri Nov 03 01:18:55 2000 +0000

description:
Pullup 1.7 [taca]:
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.

diffstat:

 usr.sbin/dhcp/omapip/dispatch.c |  7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diffs (17 lines):

diff -r 7e74658c3255 -r 898c827e6af4 usr.sbin/dhcp/omapip/dispatch.c
--- a/usr.sbin/dhcp/omapip/dispatch.c   Thu Nov 02 23:59:57 2000 +0000
+++ b/usr.sbin/dhcp/omapip/dispatch.c   Fri Nov 03 01:18:55 2000 +0000
@@ -247,6 +247,13 @@
                        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,



Home | Main Index | Thread Index | Old Index