If we get a NAK during a test, we should not read the old lease as

it's not dropped during the NAK handling.
This commit is contained in:
Roy Marples 2010-09-09 18:27:00 +00:00
parent aab7068082
commit d207e3fc4b

View File

@ -1091,6 +1091,7 @@ start_interface(void *arg)
struct stat st;
struct timeval now;
uint32_t l;
int nolease;
handle_carrier(iface->name);
if (iface->carrier == LINK_DOWN) {
@ -1098,6 +1099,9 @@ start_interface(void *arg)
return;
}
/* We don't want to read the old lease if we NAK an old test */
nolease = iface->state->offer && options & DHCPCD_TEST;
iface->start_uptime = uptime();
free(iface->state->offer);
iface->state->offer = NULL;
@ -1136,7 +1140,7 @@ start_interface(void *arg)
start_inform(iface);
return;
}
} else
} else if (!nolease)
iface->state->offer = read_lease(iface);
if (iface->state->offer) {
get_lease(&iface->state->lease, iface->state->offer);