git: 0da2c91e6452 - main - hostapd: Fix wlan interfaces not UP/RUNNING

From: Cy Schubert <cy_at_FreeBSD.org>
Date: Tue, 14 Dec 2021 14:20:11 UTC
The branch main has been updated by cy:

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

commit 0da2c91e64528d896f69d36670e25b4b4a140579
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2021-12-13 23:47:51 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2021-12-14 14:18:37 +0000

    hostapd: Fix wlan interfaces not UP/RUNNING
    
    Like wpa_supplicant, hostapd does not automatically UP the interface
    when configured. The fix is similar to 5fcdc19a8111.
    
    Reported by:    avg
    Tested by:      avg
    MFC after:      1 week
---
 libexec/rc/rc.d/hostapd | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libexec/rc/rc.d/hostapd b/libexec/rc/rc.d/hostapd
index 707316036604..7e1611350438 100755
--- a/libexec/rc/rc.d/hostapd
+++ b/libexec/rc/rc.d/hostapd
@@ -12,6 +12,13 @@
 name="hostapd"
 desc="Authenticator for IEEE 802.11 networks"
 command=${hostapd_program}
+start_postcmd="hostapd_poststart"
+
+hostapd_poststart() {
+	ifconfig ${ifn} down
+	sleep 2
+	ifconfig ${ifn} up
+}
 
 ifn="$2"
 if [ -z "$ifn" ]; then