mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-23 02:17:31 +00:00
[master] dhclient now delays between DHCPDECLINE and DHCPDISCOVER
Merges in rt45457
This commit is contained in:
parent
c0e9661e70
commit
3e88222f1c
10
RELNOTES
10
RELNOTES
@ -187,6 +187,16 @@ dhcp-users@lists.isc.org.
|
|||||||
When used in conjunction with -P, it directs dhclient to use the given
|
When used in conjunction with -P, it directs dhclient to use the given
|
||||||
length as the prefix length hint when requesting prefixes.
|
length as the prefix length hint when requesting prefixes.
|
||||||
[ISC-Bugs #43792]
|
[ISC-Bugs #43792]
|
||||||
|
[ISC-Bugs #35112]
|
||||||
|
[ISC-Bugs #32228]
|
||||||
|
[ISC-Bugs #29470]
|
||||||
|
|
||||||
|
- dhclient will now wait for 10 seconds after declining an IPv4 address
|
||||||
|
before issuing a discover. This is in keeping with RFC 2131, section 3.1.5.
|
||||||
|
Prior to this dhclient did not wait at all. The amount of time dhclient
|
||||||
|
waits can be specified via a new command line parameter:
|
||||||
|
--decline-wait-time <seconds>. A value of zero equates to no wait at all.
|
||||||
|
[ISC-Bugs #45457]
|
||||||
|
|
||||||
Changes since 4.3.0 (bug fixes)
|
Changes since 4.3.0 (bug fixes)
|
||||||
|
|
||||||
|
@ -142,6 +142,10 @@ dhclient - Dynamic Host Configuration Protocol Client
|
|||||||
.I length
|
.I length
|
||||||
]
|
]
|
||||||
[
|
[
|
||||||
|
.B --decline-wait-time
|
||||||
|
.I seconds
|
||||||
|
]
|
||||||
|
[
|
||||||
.B -v
|
.B -v
|
||||||
]
|
]
|
||||||
[
|
[
|
||||||
@ -365,6 +369,13 @@ client id in this fashion is discouraged.
|
|||||||
.BI \-I
|
.BI \-I
|
||||||
Use the standard DDNS scheme from RFCs 4701 & 4702.
|
Use the standard DDNS scheme from RFCs 4701 & 4702.
|
||||||
.TP
|
.TP
|
||||||
|
.TP
|
||||||
|
.BI \--decline-wait-time \ seconds
|
||||||
|
Specify the time (in seconds) that an IPv4 client should wait after
|
||||||
|
declining an address before issuing a discover. The default is
|
||||||
|
10 seconds as recommended by RFC 2131, Section 3.1.5. A value of
|
||||||
|
zero equates to no wait at all.
|
||||||
|
.PP
|
||||||
.BI \--version
|
.BI \--version
|
||||||
Print version number and exit.
|
Print version number and exit.
|
||||||
.PP
|
.PP
|
||||||
|
@ -68,6 +68,8 @@ int duid_type = 0;
|
|||||||
int duid_v4 = 0;
|
int duid_v4 = 0;
|
||||||
int std_dhcid = 0;
|
int std_dhcid = 0;
|
||||||
|
|
||||||
|
int decline_wait_time = 10; /* Default to 10 secs per, RFC 2131, 3.1.5 */
|
||||||
|
|
||||||
/* ASSERT_STATE() does nothing now; it used to be
|
/* ASSERT_STATE() does nothing now; it used to be
|
||||||
assert (state_is == state_shouldbe). */
|
assert (state_is == state_shouldbe). */
|
||||||
#define ASSERT_STATE(state_is, state_shouldbe) {}
|
#define ASSERT_STATE(state_is, state_shouldbe) {}
|
||||||
@ -159,17 +161,19 @@ static const char use_v6command[] = "Command not used for DHCPv4: %s";
|
|||||||
#ifdef DHCPv6
|
#ifdef DHCPv6
|
||||||
#ifdef DHCP4o6
|
#ifdef DHCP4o6
|
||||||
#define DHCLIENT_USAGE0 \
|
#define DHCLIENT_USAGE0 \
|
||||||
"[-4|-6] [-SNTPRI1dvrxi] [-nw] -4o6 <port>] [-p <port>]\n" \
|
"[-4|-6] [-SNTPRI1dvrxi] [-nw] -4o6 <port>] [-p <port>] [-D LL|LLT]\n" \
|
||||||
" [-D LL|LLT] [--dad-wait-time seconds]\n" \
|
" [--dad-wait-time <seconds>] [--prefix-len-hint <length>]\n" \
|
||||||
" [--prefix-len-hint length]\n"
|
" [--decline-wait-time <seconds>]\n"
|
||||||
#else /* DHCP4o6 */
|
#else /* DHCP4o6 */
|
||||||
#define DHCLIENT_USAGE0 \
|
#define DHCLIENT_USAGE0 \
|
||||||
"[-4|-6] [-SNTPRI1dvrxi] [-nw] [-p <port>] [-D LL|LLT]\n" \
|
"[-4|-6] [-SNTPRI1dvrxi] [-nw] [-p <port>] [-D LL|LLT]\n" \
|
||||||
" [--dad-wait-time seconds] [--prefix-len-hint length]\n"
|
" [--dad-wait-time <seconds>] [--prefix-len-hint <length>]\n" \
|
||||||
|
" [--decline-wait-time <seconds>]\n"
|
||||||
#endif
|
#endif
|
||||||
#else /* DHCPv6 */
|
#else /* DHCPv6 */
|
||||||
#define DHCLIENT_USAGE0 \
|
#define DHCLIENT_USAGE0 \
|
||||||
"[-I1dvrxi] [-nw] [-p <port>] [-D LL|LLT] \n"
|
"[-I1dvrxi] [-nw] [-p <port>] [-D LL|LLT] \n" \
|
||||||
|
" [--decline-wait-time <seconds>]\n"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DHCLIENT_USAGEC \
|
#define DHCLIENT_USAGEC \
|
||||||
@ -507,6 +511,18 @@ main(int argc, char **argv) {
|
|||||||
argv[i]);
|
argv[i]);
|
||||||
}
|
}
|
||||||
#endif /* DHCPv6 */
|
#endif /* DHCPv6 */
|
||||||
|
} else if (!strcmp(argv[i], "--decline-wait-time")) {
|
||||||
|
if (++i == argc) {
|
||||||
|
usage(use_noarg, argv[i-1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
errno = 0;
|
||||||
|
decline_wait_time = (int)strtol(argv[i], &s, 10);
|
||||||
|
if (errno || (*s != '\0') ||
|
||||||
|
(decline_wait_time < 0)) {
|
||||||
|
usage("Invalid value for "
|
||||||
|
"--decline-wait-time: %s", argv[i]);
|
||||||
|
}
|
||||||
} else if (!strcmp(argv[i], "-D")) {
|
} else if (!strcmp(argv[i], "-D")) {
|
||||||
duid_v4 = 1;
|
duid_v4 = 1;
|
||||||
if (++i == argc)
|
if (++i == argc)
|
||||||
@ -1511,7 +1527,10 @@ void bind_lease (client)
|
|||||||
#endif
|
#endif
|
||||||
finish(2);
|
finish(2);
|
||||||
} else {
|
} else {
|
||||||
state_init(client);
|
struct timeval tv;
|
||||||
|
tv.tv_sec = cur_tv.tv_sec + decline_wait_time;
|
||||||
|
tv.tv_usec = cur_tv.tv_usec;
|
||||||
|
add_timeout(&tv, state_init, client, 0, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3985,8 +4004,10 @@ void script_init(struct client_state *client, const char *reason,
|
|||||||
|
|
||||||
client_envadd (client, "", "reason", "%s", reason);
|
client_envadd (client, "", "reason", "%s", reason);
|
||||||
client_envadd (client, "", "pid", "%ld", (long int)getpid ());
|
client_envadd (client, "", "pid", "%ld", (long int)getpid ());
|
||||||
|
#if defined(DHCPv6)
|
||||||
client_envadd (client, "", "dad_wait_time", "%ld",
|
client_envadd (client, "", "dad_wait_time", "%ld",
|
||||||
(long int)dad_wait_time);
|
(long int)dad_wait_time);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user