1
0
mirror of https://github.com/openbsd/src.git synced 2026-04-30 00:56:33 +00:00

Tweak dhclient(8) timing defaults depending on SMALL rather than using

/dev/stdin to fake a dhclient.conf file during install. Simplifies and
shortens install.sub code. Allows further restrictions to be applied
to '-c' specified files.
This commit is contained in:
krw
2020-02-02 20:33:52 +00:00
parent 4ae13c9997
commit 79e9e8a118
2 changed files with 11 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
#!/bin/ksh
# $OpenBSD: install.sub,v 1.1146 2020/01/26 10:47:07 krw Exp $
# $OpenBSD: install.sub,v 1.1147 2020/02/02 20:33:52 krw Exp $
#
# Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback
# Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org>
@@ -892,11 +892,7 @@ dhcp_request() {
ifconfig $_if group dhcp >/dev/null 2>&1
if [[ -x /sbin/dhclient ]]; then
/sbin/dhclient -c /dev/stdin $_if <<__EOT
backoff-cutoff 2;
reboot 5;
timeout 10;
__EOT
/sbin/dhclient $_if
else
echo "DHCP leases not available during install - no /sbin/dhclient."
fi

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: clparse.c,v 1.194 2019/12/17 14:21:54 krw Exp $ */
/* $OpenBSD: clparse.c,v 1.195 2020/02/02 20:33:52 krw Exp $ */
/* Parser for dhclient config and lease files. */
@@ -95,11 +95,17 @@ init_config(void)
/* Set some defaults. */
config->link_timeout = 10; /* secs before going daemon w/o lease */
config->timeout = 30; /* secs to wait for an OFFER */
config->select_interval = 0; /* secs to wait for other OFFERs */
config->reboot_timeout = 1; /* secs before giving up on reboot */
config->retry_interval = 1; /* secs before asking for OFFER */
#ifdef SMALL
config->backoff_cutoff = 2; /* max secs between packet retries */
config->reboot_timeout = 5; /* secs before giving up on reboot */
config->timeout = 10; /* secs to wait for an OFFER */
#else
config->backoff_cutoff = 10; /* max secs between packet retries */
config->reboot_timeout = 1; /* secs before giving up on reboot */
config->timeout = 30; /* secs to wait for an OFFER */
#endif
config->initial_interval = 1; /* secs before 1st retry */
/* All leases must supply a subnet mask. Classful defaults are dead, Jim. */