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
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
#2
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];
##
#3
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)

#4
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 #