diff options
author | tmarkwalder <tmark@isc.org> | 2017-06-21 11:01:06 -0400 |
---|---|---|
committer | tmarkwalder <tmark@isc.org> | 2017-06-21 11:01:06 -0400 |
commit | 637e1af87177387ee1e463b8a4718f0c1ea73af5 (patch) | |
tree | 54648ca77f952a7b1980057b92e9eb646e73d80d | |
parent | f45d2f5502fd402eef3f1ea4416f03af31604999 (diff) | |
download | isc-dhcp-637e1af87177387ee1e463b8a4718f0c1ea73af5.tar.gz |
[v4_1_esv] Fixed crash in dhclient when de-preferencing a lease
Merges in rt44373.
-rw-r--r-- | RELNOTES | 6 | ||||
-rw-r--r-- | client/dhc6.c | 12 |
2 files changed, 16 insertions, 2 deletions
@@ -156,6 +156,12 @@ by Eric Young (eay@cryptsoft.com). Parker (wp02855 at gmail dot com) for reporting the issue. [ISC-Bugs #41185] +- Corrected a dhclient -6 issue that caused the client to crash with an + "Impossible condition" error after de-preferencing its only IA binding. + The crash occurred when server configuration changes rendered the existing + binding out-of-range and no other leases were available to offer. + [ISC-Bugs #44373] + Changes since 4.1-ESV-R14b1 - None diff --git a/client/dhc6.c b/client/dhc6.c index cc4453dd..f008ee17 100644 --- a/client/dhc6.c +++ b/client/dhc6.c @@ -1,7 +1,7 @@ /* dhc6.c - DHCPv6 client routines. */ /* - * Copyright (c) 2012-2016 by Internet Systems Consortium, Inc. ("ISC") + * Copyright (c) 2012-2017 by Internet Systems Consortium, Inc. ("ISC") * Copyright (c) 2006-2010 by Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and distribute this software for any @@ -4424,6 +4424,7 @@ dhc6_check_times(struct client_state *client) TIME renew=MAX_TIME, rebind=MAX_TIME, depref=MAX_TIME, lo_expire=MAX_TIME, hi_expire=0, max_ia_starts = 0, tmp; int has_addrs = ISC_FALSE; + int has_preferred_addrs = ISC_FALSE; struct timeval tv; lease = client->active_lease; @@ -4452,6 +4453,10 @@ dhc6_check_times(struct client_state *client) if (tmp < depref) depref = tmp; + + if (!(addr->flags & DHC6_ADDR_EXPIRED)) { + has_preferred_addrs = ISC_TRUE; + } } if (!(addr->flags & DHC6_ADDR_EXPIRED)) { @@ -4610,7 +4615,10 @@ dhc6_check_times(struct client_state *client) break; default: - log_fatal("Impossible condition at %s:%d.", MDL); + if (has_preferred_addrs) { + log_fatal("Impossible condition, state %d at %s:%d.", + client->state, MDL); + } } /* Separately, set a time at which we will depref and expire |