From: bluhm Date: Tue, 24 Aug 2021 21:50:09 +0000 (+0000) Subject: Fix automatic upgrade after fetching response file with dhcp. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8dce61490a8e32f4fc09942fdca3a5759baaf41c;p=openbsd Fix automatic upgrade after fetching response file with dhcp. When the auto upgrader tried to fetch the sets, sometimes ftp did not find any. The interface was down and had no address. As autoconf was not cleared, the upgrade's static netstart and dhcpleased both tried to configure the interface, which cannot work. Disable dhcp with "ifconfig inet -autoconf" in get_responsefile() after it is not used anymore. OK florian@ --- diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index d09093ba37f..dfd396c686d 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sub,v 1.1172 2021/08/09 13:56:17 sthen Exp $ +# $OpenBSD: install.sub,v 1.1173 2021/08/24 21:50:09 bluhm Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015, Robert Peichaer @@ -656,7 +656,8 @@ get_responsefile() { echo "Fetching $_url" if unpriv ftp -Vo - "$_url" \ >"/tmp/ai/ai.$AI_MODE.conf" 2>/dev/null; then - ifconfig $_if delete down 2>/dev/null + ifconfig $_if inet -autoconf delete down \ + 2>/dev/null rm /var/db/dhcpleased/$_if return 0 fi @@ -685,7 +686,7 @@ get_responsefile() { echo "Fetching $_rf" [[ -f $_rf ]] && _rf="file://$_rf" if unpriv ftp -Vo - "$_rf" >"/tmp/ai/ai.$AI_MODE.conf" 2>/dev/null; then - ifconfig $_if delete down 2>/dev/null + ifconfig $_if inet -autoconf delete down 2>/dev/null return 0 fi return 1