mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-09-01 06:45:27 +00:00
Fix bug in secs handling.
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char ocopyright[] =
|
static char ocopyright[] =
|
||||||
"$Id: dhclient.c,v 1.62 1999/03/16 05:50:30 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: dhclient.c,v 1.63 1999/03/25 21:51:29 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -1080,10 +1080,11 @@ void send_discover (cpp)
|
|||||||
client -> config -> timeout) - cur_time + 1;
|
client -> config -> timeout) - cur_time + 1;
|
||||||
|
|
||||||
/* Record the number of seconds since we started sending. */
|
/* Record the number of seconds since we started sending. */
|
||||||
if (interval < 255)
|
if (interval < 65536)
|
||||||
client -> packet.secs = interval;
|
client -> packet.secs = htons (interval);
|
||||||
else
|
else
|
||||||
client -> packet.secs = 255;
|
client -> packet.secs = htons (65535);
|
||||||
|
client -> secs = client -> packet.secs;
|
||||||
|
|
||||||
log_info ("DHCPDISCOVER on %s to %s port %d interval %ld",
|
log_info ("DHCPDISCOVER on %s to %s port %d interval %ld",
|
||||||
client -> name ? client -> name : client -> interface -> name,
|
client -> name ? client -> name : client -> interface -> name,
|
||||||
@@ -1320,10 +1321,14 @@ void send_request (cpp)
|
|||||||
from.s_addr = INADDR_ANY;
|
from.s_addr = INADDR_ANY;
|
||||||
|
|
||||||
/* Record the number of seconds since we started sending. */
|
/* Record the number of seconds since we started sending. */
|
||||||
if (interval < 255)
|
if (client -> state == S_REQUESTING)
|
||||||
client -> packet.secs = interval;
|
client -> packet.secs = client -> secs;
|
||||||
else
|
else {
|
||||||
client -> packet.secs = 255;
|
if (interval < 65536)
|
||||||
|
client -> packet.secs = htons (interval);
|
||||||
|
else
|
||||||
|
client -> packet.secs = htons (65535);
|
||||||
|
}
|
||||||
|
|
||||||
log_info ("DHCPREQUEST on %s to %s port %d",
|
log_info ("DHCPREQUEST on %s to %s port %d",
|
||||||
client -> name ? client -> name : client -> interface -> name,
|
client -> name ? client -> name : client -> interface -> name,
|
||||||
|
Reference in New Issue
Block a user