#!/bin/ksh
-# $OpenBSD: install.sub,v 1.1187 2022/01/05 16:35:35 deraadt Exp $
+# $OpenBSD: install.sub,v 1.1188 2022/01/11 00:48:45 deraadt Exp $
#
# Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback
# Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org>
}
# Configure the network during upgrade based on the on-disk configuration.
-enable_network() {
- local _f _gw _v4set=false _v6set=false _hn _if _trunks _svlans _vlans
-
- # Use installed network configuration files during upgrade.
- for _f in dhclient.conf resolv.conf; do
- if [[ -f /mnt/etc/$_f ]]; then
- cp /mnt/etc/$_f /etc/$_f
- fi
- done
-
- # Create a minimal hosts file.
- echo "127.0.0.1\tlocalhost" >/tmp/i/hosts
- echo "::1\t\tlocalhost" >>/tmp/i/hosts
-
- _f=/mnt/etc/soii.key
- [[ -f $_f ]] && sysctl "net.inet6.ip6.soiikey=$(<$_f)"
+enable_ifs() {
+ local _gw _v4set=false _v6set=false _hn _if _trunks _svlans _vlans
# Set the address for the loopback interface. Bringing the
# interface up, automatically invokes the IPv6 address ::1.
route -qn add -net 127 127.0.0.1 -reject >/dev/null
}
+enable_network() {
+ local _f
+
+ # Use installed network configuration files during upgrade.
+ for _f in dhclient.conf resolv.conf; do
+ if [[ -f /mnt/etc/$_f ]]; then
+ cp /mnt/etc/$_f /etc/$_f
+ fi
+ done
+
+ # Create a minimal hosts file.
+ echo "127.0.0.1\tlocalhost" >/tmp/i/hosts
+ echo "::1\t\tlocalhost" >>/tmp/i/hosts
+
+ _f=/mnt/etc/soii.key
+ [[ -f $_f ]] && sysctl "net.inet6.ip6.soiikey=$(<$_f)"
+
+ enable_ifs
+}
+
# Fetch the list of mirror servers and installer choices from previous runs if
# available from ftplist.cgi. Start the ftp process in the background, but kill
# it if it takes longer than 12 seconds.