Skip to content
Permalink
Browse files

Probe for wireless interfaces using sysctl.

In FreeBSD HEAD, raw wireless devices don't show up in `ifconfig`.
Expose to OPNSense the wireless devices as per the net.wlan.devices
sysctl.

Signed-off-by:	Shawn Webb <shawn.webb@hardenedbsd.org>
  • Loading branch information...
lattera committed Jan 30, 2016
1 parent ad6fd99 commit 7c4dd2a6178343fa37880810ea94cadc141c0c78
Showing with 15 additions and 0 deletions.
  1. +15 −0 src/etc/inc/interfaces.lib.inc
@@ -47,6 +47,21 @@ function legacy_interface_listget($flag = '')
$ifs = explode(' ', $out[0]);
}
/*
* If we are running -CURRENT, wireless devices are exposed
* via the sysctl net.wlan.devices.
*/
unset($out);
unset($ret);
exec('/sbin/sysctl -n net.wlan.devices', $out, $ret);
if ($ret) {
return ($ifs);
}
foreach (explode(' ', trim($out[0])) as $wlandev) {
$ifs[] = $wlandev;
}
return ($ifs);
}

0 comments on commit 7c4dd2a

Please sign in to comment.
You can’t perform that action at this time.