From: krw Date: Sun, 13 Jul 2014 14:50:03 +0000 (+0000) Subject: When renewing a lease, update client->active or you end up in a X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c36dd2c943f7b3cfbf24d93c552313b79d66d2f0;p=openbsd When renewing a lease, update client->active or you end up in a tight renew loop. Caused by recent reshuffling of code in bind_lease(). --- diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index b5264ce7d39..7562a3e23a7 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.317 2014/07/12 21:04:07 krw Exp $ */ +/* $OpenBSD: dhclient.c,v 1.318 2014/07/13 14:50:03 krw Exp $ */ /* * Copyright 2004 Henning Brauer @@ -840,9 +840,11 @@ bind_lease(void) compare_lease(client->active, client->new) == 0) { client->new->resolv_conf = client->active->resolv_conf; client->active->resolv_conf = NULL; + client->active = client->new; + client->new = NULL; note("bound to %s -- renewal in %lld seconds.", - inet_ntoa(client->new->address), - (long long)(client->new->renewal - time(NULL))); + inet_ntoa(client->active->address), + (long long)(client->active->renewal - time(NULL))); goto newlease; }