rc.d/netif: Rework wlan interface configuration
authorAaron LI <aly@aaronly.me>
Wed, 12 Dec 2018 03:52:24 +0000 (11:52 +0800)
committerAaron LI <aly@aaronly.me>
Wed, 12 Dec 2018 15:24:40 +0000 (23:24 +0800)
commit3928a593ab3010edcf0cb7727946eafd6f5cfd40
treef2ada0515a7623825562e1fb169e1e11d8a48fb5
parent5ad36ff1bf17fc3ebb85aa68fd9360993939d26d
rc.d/netif: Rework wlan interface configuration

* wlan interfaces are more similar to clonable interfaces rather than
  vlan interfaces, so move the relevant code from childif_create() to
  network.subr as wlan_up(), which will be called to create the wlan
  interfaces before setting up them.

  Now, list_net_interfaces() shouldn't list "net.wlan.devices".

* Add the wlan_down() function in network.subr to destroy the wlan
  devices.

* Meanwhile, fix childif_destroy() to properly destroy the vlan
  interfaces created by childif_create().  Also tweak the order of this
  function in netif_stop().

* The 2-second delay in netif_start() doesn't apply anymore, since the
  DHCP and WPA configurations are now handled in ifconfig_up() called by
  ifn_start().

This patch is loosely based on FreeBSD's code.  Thanks to them.
etc/network.subr
etc/rc.d/netif