Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - binaryx

#1
Quote from: binaryx on August 13, 2026, 01:56:37 PMsorry .. ;) as removed some config had to revert :D .. seems ok to me

ath0_wlan1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
   description: W5G (opt1)
   options=0
   ether 48:8f:5a:64:83:71
   inet 10.0.1.254 netmask 0xffffff00 broadcast 10.0.1.255
   groups: wlan
   ssid ~~~~~ channel 52 (5260 MHz 11a ht/20) bssid 48:8f:5a:64:83:71
   regdomain ETSI2 country SK indoor ecm authmode WPA2/802.11i
   privacy MIXED deftxkey 2 AES-CCM 2:128-bit AES-CCM 3:128-bit
   txpower 24 mcastrate 6 mgmtrate 6 scanvalid 60 ampdulimit 64k
   ampdudensity 8 shortgi -uapsd burst -apbridge dtimperiod 1 -dfs
   parent interface: ath0
   media: IEEE 802.11 Wireless Ethernet autoselect mode 11na <hostap>
   status: running
   nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
#2
sorry .. ;) as removed some config had to revert :D .. seems ok to me
#3
is related to the upgrade of hostapd

root@#host#:/tmp # hostapd -v
hostapd v2.11
User space daemon for IEEE 802.11 AP management,
IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
Copyright (c) 2002-2024, Jouni Malinen <j@w1.fi> and contributors
root@#host#:/tmp # hostapd /tmp/test_hostapd.conf
ath0_wlan1: interface state UNINITIALIZED->ENABLED
ath0_wlan1: AP-ENABLED
^Cath0_wlan1: interface state ENABLED->DISABLED
ath0_wlan1: AP-DISABLED
ath0_wlan1: CTRL-EVENT-TERMINATING
root@#host#:/tmp # /usr/local/sbin/hostapd -v
hostapd v2.12
User space daemon for IEEE 802.11 AP management,
IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
Copyright (c) 2002-2026, Jouni Malinen <j@w1.fi> and contributors
root@#host#:/tmp # /usr/local/sbin/hostapd /tmp/test_hostapd.conf
No drivers enabled
Failed to initialize global context
root@#host#:/tmp # cat /tmp/test_hostapd.conf
interface=ath0_wlan1
driver=bsd
ssid=testchannel=1
root@#host#:/tmp #
#4
Hi

is bsd_ driver not compiled with the 2.12 version of hostapd ?

# strings /usr/local/sbin/hostapd | grep bsd_
bsd_route_overflow
bsd_init
bsd_wireless_event_receive
bsd_set_freq
bsd_set_opt_ie
bsd_get_seqnum
bsd_set_key
bsd_del_key
bsd_set_ieee8021x
bsd_get_if_media
bsd_ctrl_iface
bsd_configure_wpa
bsd_set_if_media
bsd_set_privacy

vs new 2.12
# strings /usr/local/sbin/hostapd | grep bsd_
#

which may be confirmed by running
# /usr/local/sbin/hostapd -B -P '/var/run/hostapd_ath0_wlan1.pid' '/var/etc/hostapd_ath0_wlan1.conf'
No drivers enabled
Failed to initialize global context

have bit different hw but similar conf content

#5
Patched yesterday opensense with as bundle so with router restart, when the interface is configured with mode it will fail as mode is non-empty:

in the log you can see
/usr/local/etc/rc.linkup: The command </sbin/ifconfig wlan create wlandev 'ath0' 'wlanmode hostap' bssid name 'ath0_wlan1'> returned exit code 1 and the output was "ifconfig: SIOCIFCREATE2 (wlan): Input/output error"

the issue is that escapeshellarg() convert "wlanmode hostap" into "'wlanmode hostap'" which isn't valid param as there must not be any ''

correct cmd:
/sbin/ifconfig wlan create wlandev 'ath0' wlanmode hostap bssid name 'ath0_wlan1'
what we get from escape ..
/sbin/ifconfig wlan create wlandev 'ath0' 'wlanmode hostap' bssid name 'ath0_wlan1'

this also makes the new fix/commit not requried, but no overwiew on whole code so just statement base on the troubleshooting
#6
Quote from: franco on February 02, 2026, 09:18:31 PMThank you, that was the missing puzzle piece here.

How about https://github.com/opnsense/core/commit/45597a976c4 ?


Cheers,
Franco


the commit works on my end.

maybe if i may suggest:
 - is shorter (as you dont want to use sprintf())
 - easier to follow in the future

##
$wlan_frmt = '/sbin/ifconfig wlan create wlandev %s '.($mode !== '' ? '%s' : '').' bssid name %s';
$wlan_args = [$baseif, ...($mode !== '' ? [$mode] : []), $device];
##
#7
Quote from: franco on February 02, 2026, 08:53:23 AMAre you referring to this commit? https://github.com/opnsense/core/commit/7e93cdb63f030

I'm not catching the error in either, which doesn't mean it's not there.

Might be worth checking the system log file as well for "ifconfig" failures.


Cheers,
Franco

Is the commit, in my case the issue start with "$mode" as is empty (have PC Engines APU2 HW, HW isn't important from my pov) but new function mwexecf() translates the 2nd %s (for $mode) to regular '' instead of none/null, so ifconfig will return non-zero exit code as '' is not valid parameter for it; so the escape handling need to be fine tuned (did not look into git code so not sure if simple or with more effort).

had to revert to get a log as rotated ;)

latest.log:<11>1 2026-02-02T20:00:36+01:00 ~~~~~~~ opnsense 92351 - [meta sequenceId="1"] /interfaces_wireless_edit.php: The command </sbin/ifconfig wlan create wlandev 'ath0' '' bssid name 'ath0_wlan2'> returned exit code 1 and the output was "ifconfig: : bad value wlan1"
system_20260202.log:<11>1 2026-02-02T20:00:36+01:00 ~~~~~~~ opnsense 92351 - [meta sequenceId="1"] /interfaces_wireless_edit.php: The command </sbin/ifconfig wlan create wlandev 'ath0' '' bssid name 'ath0_wlan2'> returned exit code 1 and the output was "ifconfig: : bad value wlan1"

and "wlan1" is created (as i have ath0_wlan1 already configured so is bit misleading but you get the point)

#8
root@~~~~~~~:/usr/local/www # diff /usr/local/etc/inc/interfaces.inc*
1693,1696c1693
<         $doExec = sprintf('/sbin/ifconfig wlan create wlandev %s %s bssid name %s', $baseif, $mode, $device);
<
<         #if (mwexecf('/sbin/ifconfig wlan create wlandev %s %s bssid name %s', [$baseif, $mode, $device])) {
<         if (mwexecf($doExec)) {
---
>         if (mwexecf('/sbin/ifconfig wlan create wlandev %s %s bssid name %s', [$baseif, $mode, $device])) {
root@~~~~~~~:/usr/local/www #