From a6fe94ac049beafc5b294ef02622d4404c684ecf Mon Sep 17 00:00:00 2001 From: krw Date: Thu, 1 Apr 2021 13:17:48 +0000 Subject: [PATCH] Also immediately accept the *first* OFFER if it matches the requested address, rather than waiting for select_timeout to expire before accepting the same OFFER. --- sbin/dhclient/dhclient.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 725c03fa11d..43b6c8bed16 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.718 2021/03/31 21:17:46 krw Exp $ */ +/* $OpenBSD: dhclient.c,v 1.719 2021/04/01 13:17:48 krw Exp $ */ /* * Copyright 2004 Henning Brauer @@ -923,12 +923,15 @@ process_offer(struct interface_info *ifi, struct option_data *options, ifi->offer = lease; free(ifi->offer_src); ifi->offer_src = strdup(src); /* NULL is OK */ - ifi->select_timeout = now; } + if (ifi->offer != lease) { make_decline(ifi, lease); send_decline(ifi); free_client_lease(lease); + } else if (ifi->offer->address.s_addr == + ifi->requested_address.s_addr) { + ifi->select_timeout = now; } } -- 2.20.1