From patchwork Wed Apr 29 19:49:26 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 9765 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail01.haj.ipfire.org", Issuer "R12" (not verified)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4g5SZ32KCGz3wpF for ; Wed, 29 Apr 2026 19:49:47 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [IPv6:2001:678:b28::201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail02.haj.ipfire.org", Issuer "E8" (not verified)) by mail01.ipfire.org (Postfix) with ESMTPS id 4g5SZ24hxxz7Pj for ; Wed, 29 Apr 2026 19:49:46 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4g5SZ16gH0z3340 for ; Wed, 29 Apr 2026 19:49:45 +0000 (UTC) X-Original-To: development@lists.ipfire.org Received: from mail01.ipfire.org (mail01.haj.ipfire.org [IPv6:2001:678:b28::25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail01.haj.ipfire.org", Issuer "R12" (not verified)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4g5SYt0JQdz308h for ; Wed, 29 Apr 2026 19:49:38 +0000 (UTC) Received: from michael.haj.ipfire.org (michael.haj.ipfire.org [172.28.1.242]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bit raw public key) server-digest SHA256 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "michael.haj.ipfire.org", Issuer "E7" (not verified)) by mail01.ipfire.org (Postfix) with ESMTPS id 4g5SYs4bvSz5P8; Wed, 29 Apr 2026 19:49:37 +0000 (UTC) Received: by michael.haj.ipfire.org (Postfix, from userid 0) id 4g5SYs3lH8zTh5L; Wed, 29 Apr 2026 19:49:37 +0000 (UTC) From: Michael Tremer To: development@lists.ipfire.org Cc: Michael Tremer Subject: [PATCH 1/9] hostapd: Force setting reg domain before hostapd starts Date: Wed, 29 Apr 2026 19:49:26 +0000 Message-ID: <20260429194934.863108-1-michael.tremer@ipfire.org> X-Mailer: git-send-email 2.47.3 Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 When the system boots up, it could happen that hostapd didn't come up the first time: Apr 28 15:18:10 ipfire-test hostapd: green0: interface state UNINITIALIZED->COUNTRY_UPDATE Apr 28 15:18:10 ipfire-test hostapd: ACS: Automatic channel selection started, this may take a bit Apr 28 15:18:10 ipfire-test hostapd: ACS: No available channels found Apr 28 15:18:10 ipfire-test hostapd: green0: IEEE 802.11 Configured channel (0) or frequency (0) (secondary_channel=1) not found from the channel list of the current mode (2) IEEE 802.11a Apr 28 15:18:10 ipfire-test hostapd: green0: IEEE 802.11 Hardware does not support configured channel Apr 28 15:18:10 ipfire-test hostapd: Could not select hw_mode and channel. (-3) Apr 28 15:18:10 ipfire-test hostapd: green0: interface state COUNTRY_UPDATE->DISABLED Apr 28 15:18:10 ipfire-test hostapd: green0: AP-DISABLED Apr 28 15:18:10 ipfire-test hostapd: green0: interface state DISABLED->DISABLED Apr 28 15:18:10 ipfire-test hostapd: green0: AP-DISABLED Apr 28 15:18:10 ipfire-test hostapd: green0: CTRL-EVENT-TERMINATING Apr 28 15:18:10 ipfire-test hostapd: hostapd_free_hapd_data: Interface green0 wasn't started Apr 28 15:18:10 ipfire-test hostapd: nl80211: deinit ifname=green0 disabled_11b_rates=0 A second start always was successful. By explicitely setting the reg domain this problem is being worked around. Signed-off-by: Michael Tremer --- src/initscripts/packages/hostapd | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/initscripts/packages/hostapd b/src/initscripts/packages/hostapd index 93ddae72f..583a8eba4 100644 --- a/src/initscripts/packages/hostapd +++ b/src/initscripts/packages/hostapd @@ -685,6 +685,11 @@ case "${1}" in exit 1 fi + # Force setting the regulatory domain + if [ -n "${CONFIG["COUNTRY"]}" ]; then + iw reg set "${CONFIG["COUNTRY"]}" &>/dev/null + fi + # Compose the command line args=( /usr/bin/hostapd