git: cce4df8b3cbc - releng/14.2 - bsdinstall: wlanconfig: fix interface UP on (re-)starting wpa_supplicant

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Thu, 21 Nov 2024 23:26:26 UTC
The branch releng/14.2 has been updated by bz:

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

commit cce4df8b3cbcf4f58890048e608399471fc214f7
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2024-11-09 01:10:33 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2024-11-21 23:24:47 +0000

    bsdinstall: wlanconfig: fix interface UP on (re-)starting wpa_supplicant
    
    Make sure an interface is back up before (re-)starting wpa_supplicant
    in wlanconfig not relying on wpa to UP the interface (though we fixed
    that).
    
    Sponsored by:   The FreeBSD Foundation
    Reviewed by:    emaste (in D47491)
    Approved by:    re (cperciva)
    Differential Revision: https://reviews.freebsd.org/D47491
    
    (cherry picked from commit 5399052c63a7a3d2f54615d31bfd092ab887a600)
    (cherry picked from commit 7d0c12e1f907ddf9be6668449a966703c0f781d1)
---
 usr.sbin/bsdinstall/scripts/wlanconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/usr.sbin/bsdinstall/scripts/wlanconfig b/usr.sbin/bsdinstall/scripts/wlanconfig
index 338e4f0a4109..728833f8d4a0 100755
--- a/usr.sbin/bsdinstall/scripts/wlanconfig
+++ b/usr.sbin/bsdinstall/scripts/wlanconfig
@@ -55,7 +55,8 @@ country_set()
 		"$WLAN_IFACE" "$ifconfig_args"
 	error_str="${error_str#ifconfig: }"
 	# Restart wpa_supplicant(8) (should not fail).
-	[ "$iface_up" ] && f_eval_catch -d wlanconfig wpa_supplicant \
+	[ "$iface_up" ] && ifconfig "$WLAN_IFACE" up && \
+	    f_eval_catch -d wlanconfig wpa_supplicant \
 		'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \
 		"$WLAN_IFACE" "$BSDINSTALL_TMPETC"
 	if [ "$error_str" ]; then