mirror of
https://github.com/rsmarples/dhcpcd.git
synced 2024-11-28 04:25:19 +08:00
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:
parent
aab7068082
commit
d207e3fc4b
6
dhcpcd.c
6
dhcpcd.c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user