From: Roy Marples Date: Thu, 9 Sep 2010 18:27:00 +0000 (+0000) Subject: If we get a NAK during a test, we should not read the old lease as X-Git-Tag: v5.2.9~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d207e3fc4b470625b7f9beff082cf71a0b968201;p=thirdparty%2Fdhcpcd.git If we get a NAK during a test, we should not read the old lease as it's not dropped during the NAK handling. --- diff --git a/dhcpcd.c b/dhcpcd.c index 8bfa8dd7..02a1fd29 100644 --- a/dhcpcd.c +++ b/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);