What changed in rc.d infrastructure in last months?

NGie Cooper yaneurabeya at gmail.com
Sun Oct 25 19:39:53 UTC 2015


> On Oct 25, 2015, at 12:30, NGie Cooper <yaneurabeya at gmail.com> wrote:

…

> 445 # hostapif if
> 446 #       Returns 0 if the interface is a HOSTAP interface and 1 otherwise.
> 447 hostapif()
> 448 {
> 449         local _tmpargs _arg
> 450         _tmpargs=`_ifconfig_getargs $1`
> 451 
> 452         for _arg in $_tmpargs; do
> 453                 case $_arg in
> 454                 [Hh][Oo][Ss][Tt][Aa][Pp])
> 455                         return 0
> 456                         ;;
> 457                 esac
> 458         done
> 459 
> 460         return 1
> 461 }

Here’s an example of how this works, by the way:

$ sh find_hostapifs.sh
wlan1 is!
$ cat find_hostapifs.sh
. /etc/rc.subr
load_rc_config

. /etc/network.subr
for i in em0 wlan0 wlan1; do
        hostapif $i && echo "$i is!”
done
$ grep ^ifconfig /etc/rc.conf
ifconfig_em0="inet W.X.Y.Z netmask 255.255.255.0"
ifconfig_em0_ipv6="inet6 accept_rtadv"
ifconfig_wlan0="inet 127.0.0.2/8"
ifconfig_wlan1=“hostap”
$

It’s documented here:

                 On the other hand, if you want to configure your wireless
                 interface with hostapd(8), you need to add ``HOSTAP'' to the
                 ifconfig_<interface> variable.  hostapd(8) will use the
                 settings from /etc/hostapd-<interface>.conf

Cheers,
-NGie


More information about the freebsd-current mailing list