Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Sep 2024 01:47:59 GMT
From:      Jessica Clarke <jrtc27@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: aaf4d3f3d194 - stable/14 - bsdinstall: Fix netconfig script when no interfaces are present
Message-ID:  <202409070147.4871lxuF041686@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by jrtc27:

URL: https://cgit.FreeBSD.org/src/commit/?id=aaf4d3f3d1947531cc81f90ea5af522c719857ff

commit aaf4d3f3d1947531cc81f90ea5af522c719857ff
Author:     Jessica Clarke <jrtc27@FreeBSD.org>
AuthorDate: 2024-02-03 01:52:37 +0000
Commit:     Jessica Clarke <jrtc27@FreeBSD.org>
CommitDate: 2024-09-07 00:00:46 +0000

    bsdinstall: Fix netconfig script when no interfaces are present
    
    The script uses [ -z "$INTERFACES" ] to check if the list of interfaces
    is empty and will exit early if so, but INTERFACES always contains at
    least a space due to the way it appends the list of wireless devices.
    Fix this by only adding the space when there are devices to append,
    mirroring the behaviour for non-wireless devices above (both will result
    in a redundant leading space when the list is non-empty, but that one is
    harmless).
    
    Fixes:          159ca5c844cd ("Adapt to new wireless scheme where base wlan interfaces do not show up in ifconfig anymore.")
    MFC after:      1 week
    
    (cherry picked from commit b809c7d6a26924ac351e49a15011da718cc3feec)
---
 usr.sbin/bsdinstall/scripts/netconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/usr.sbin/bsdinstall/scripts/netconfig b/usr.sbin/bsdinstall/scripts/netconfig
index bdbbd42b3328..300dcc6f5e5e 100755
--- a/usr.sbin/bsdinstall/scripts/netconfig
+++ b/usr.sbin/bsdinstall/scripts/netconfig
@@ -49,7 +49,8 @@ for IF in `ifconfig -l`; do
 	INTERFACES="$INTERFACES $IF"
 done
 
-INTERFACES="$INTERFACES $(sysctl -in net.wlan.devices)"
+WIRELESS_INTERFACES="$(sysctl -in net.wlan.devices)"
+INTERFACES="$INTERFACES${WIRELESS_INTERFACES:+ }$WIRELESS_INTERFACES"
 is_wireless_if() {
 	for IF in $(sysctl -in net.wlan.devices); do
 		if [ $IF = $1 ]; then



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202409070147.4871lxuF041686>