git: 27f7ead17779 - stable/12 - hostapd: Fix wlan interfaces not UP/RUNNING

From: Cy Schubert <cy_at_FreeBSD.org>
Date: Tue, 21 Dec 2021 23:37:55 UTC
The branch stable/12 has been updated by cy:

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

commit 27f7ead17779011ef0c5ea5fbf2d72fb340b1f3f
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2021-12-13 23:47:51 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2021-12-21 23:37:24 +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
    
    (cherry picked from commit 0da2c91e64528d896f69d36670e25b4b4a140579)
---
 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