Skip to content

Commit

Permalink
Probe for wireless interfaces using sysctl.
Browse files Browse the repository at this point in the history
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 7c4dd2a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/etc/inc/interfaces.lib.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 7c4dd2a

Please sign in to comment.