From 9e177caab2b67c448dce9a137f0069446e99e7c4 Mon Sep 17 00:00:00 2001 From: krw Date: Wed, 31 Mar 2021 21:17:46 +0000 Subject: [PATCH] Set 'select_timeout' to 'now' when an OFFER is received for the IP address requested in the DISCOVER. i.e. immediately accept the OFFER rather than waiting for select_timeout to expire before accepting the same OFFER. A corner case since select-timeout is 0 by default. --- sbin/dhclient/dhclient.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 919c6e64eb3..725c03fa11d 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.717 2021/03/31 20:52:09 krw Exp $ */ +/* $OpenBSD: dhclient.c,v 1.718 2021/03/31 21:17:46 krw Exp $ */ /* * Copyright 2004 Henning Brauer @@ -923,6 +923,7 @@ 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); -- 2.20.1