Drop -o from dhcpcd options as all dhcpcd versions in portage have been
patches to not bring the interface down and future versions may not
support that option as they won't bring the interface down at all.
Fix frequency parsing and add channel parsing to iwconfig, #143698

Ensure that we call halt.sh in a new shell with LC_ALL=C so that we don't
load any locale information which may stop us unmounting /usr, #128848
and #133090.
Don't set clock for OpenVZ systems, #133265 thanks to Kir Kolyshkin.
Don't remount / in checkroot for unionfs /, #129975 thanks to Daniel.
Don't stop net interfaces / is unionfs and a branch is network mounted.

runscript.sh now has a --nodeps option so that no depends are checked
when starting and stopping a service.
net.lo and system modules now support resolvconf instead of using our
own internal system.
DHCP and PPP clients no longer have helper scripts. As such they don't
change service status at all. Moved helpers.d/functions back into net.lo
Moved {get,save}_options from functions.sh to rc-services.sh
Removed whole load of crud from hostname init script, fixes #38172 again
and #122794. Also, it's no longer a critical service as defined by rc.
Added net modules for ccwgroup (s390 qeth ethernet) and br2684ctl
(speedtouch usb).
Removed xargs and find from all net scripts as /usr maybe net mounted,
#107260.
Punted the domainname script. Functionality has been in conf.d/net so you
can do this.
ppd module now checks to see if link exists if prefixed with /, #126916.

net script modules variables function has been moved into module_expose
and removed from module_depend to be more correct.
net script modules have had #!/bin/bash removed from the top and now
set vim fs=sh to be more correct.

$myservice is now deprecated for init scripts.
$SVCNAME should be used instead and is read-only so it cannot be
clobbered.
Several variables in global scope that provided functions rely on,
such as BOOTLEVEL, SOFTLEVEL and svcdir are now read only for init
scripts.
depscan.sh now accepts the --svcdir option so that svcdir can now be
specified as the variable is marked readonly in functions.sh. Splash
programs will have to be updated.

Misc STYLE and quoting issues fixes in net scripts.
dhclient and udhcpc now work with RFC violating space separated
domain names in /etc/resolv.conf - they get appended to the search
option if it's not specified.
punted clean_pidfile and process_finished functions and as
start-stop-daemon as provided by rc-daemon.sh now provides
the same thing, just better.

Always ensure the end_service is called, #119233 again.
You can now specify a maxfail value for pppd (default 0), #115346.
net.lo now depends on isapnp to work with older NICs, #121539.
chat commands in pppd are now re-quoted, #121665.
ip routing policies are now supports via the rule_eth0=( ... )
variable (only supported by iproute2), #107628.
wpa_supplicant now looks for config files in order
/etc/wpa_supplicant/wpa_supplicant-$iface.conf
/etc/wpa_supplicant/wpa_supplicant.conf
/etc/wpa_supplicant.conf
and for these wpa_cli scripts
/etc/wpa_supplicant/wpa_cli.sh
/sbin/wpa_cli.action

Fix quoting in iwconfig, #119629.
Fix process pid selection in rc-daemon.sh, #119631.
Both of the above thanks to Dominik Buerkle.
init scripts no longer run during the sysinit runlevel, #118419.
Thanks to Greg KH and the Linux Hotplug mailing list for advice.

iwconfig now supports multiple iwconfig_* and iwpriv_* statements and is
also configurable for specific ESSIDs. This allows use to use the inbuilt
WPA support in the rt2500 driver.
module-loader now loads interface specific configuration files, #118366.

Changed from eval foo=\"\$config_$ifvar\" to foo=config_$ivar; foo=$!foo
This is to avoid using the eval statement to extract user configured vars.
Enhanced pppd module so that it obeys metric routes, does not mess
with the system resolv.conf and works with updetach a bit better, #112049.
Fixed pointotpoint, #112757.

New net scripts depend calls - functions, variables and provide.
This saves having to create 3 seperate functions in each module which means
a saving of around 600-800 bytes per module.
Split apipa out of arping module due to user demand for seperate
functionality.
arping module now works correctly.
runscript sets RC_KILL_CHILDREN=no when restarting a service, otherwise
things like your ssh session get killed.
adsl module supports new rp-pppoe-3.6 ebuild, #102820
Config profile is now changed correctly when doing 'rc foo' and you're in
the default runlevel, #101105

updated env_whitelist so that nothing is allowed by default
system module now runs through pre instead of post and is run by
lo as well, so dns_ options can be configured for it
netplug and wpa_supplicant understand negative timeouts to be defined
as "return immediately and dont wait for success"
dns options and sortlist now get merged in resolv.conf too
bridge error message regarding the kernel module should work with
newer versions of bridge-utils

service status requests (either by /etc/init.d/foo status or rc-status)
now update the service status by checking daemons and/or pidfiles to check if they are still running or not. To update the status in your own code,
source "${svclib}/sh/rc-daemon.sh" and call
update_service_status "${service}"
Trimmed $Header$ from a few files

RC_AUTO_INTERFACE defaults to NO - but we still default to DHCP
consoletype is now cached. This has the benefit of being very slightly
faster and you now get coloured text for parallel startup
Parallel startup also does parallel shutdown as well
You're now warned if you're using a deprecated conf.d/net syntax

Minor tweaks to all dhcp modules - basically better quoting so that
the eval calls work better
pump can now be backgrounded
Tweaked the dhcp helpers so that more code is shared
A few tweaks to runscript.sh and rc-services.sh to avoid races

dhclient now parses dhclient_eth0 for -cf parameter to set
dhclient now strips lines starting with script and send host-name
from and adds send host-name uberlaptop; at the top
To stop this behaviour, add dhclient_edit_config=no to /etc/conf.d/net
Fixes #96322
Removed killing udhcpc hard as it now dies nicely

wpa_supplicant now respects the background=no option if
wpa_suppliant>=0.4.0 is installed
fixed network dependencies some more
You can now restart a script marked starting/inactive
Documented the use of the RC_USE_CONFIG_PROFILE variable in conf.d/rc
udhcpc now removes stale pidfiles

Fixed VLAN documentation for working with eth0.1 style names #95121
tarball.sh now works with svn
dhclient and udhcpc now report any errors to stdout
RC_DEVICE_TARBALL now defaults to no
STYLE updates to iwconfig

You can now configure all options via the MAC address of your network card
and the MAC address of AP you connect to like so
config_001122334455=( "192.168.0.2/24 brd +")
Fixes the last part of #52975
The old way of configuring for the MAC address of the AP is no longer
supported

Changed "sed -ne" to "sed -n -e" for portability.
Added auto_interface (default yes).
if auto_interface is yes then we
*) default to dhcp
*) automatically calculate a metric (this may need work)
*) select the best interface based on metric
(restore resolv.conf, ntp.conf and yp.conf we have saved)
otherwise we
*) default to null
wpa_supplicant no longer kills itself when we're not stopping the interface
it's running on.
wpa_supplicant now uses wpa_monitor (yet to be released) if available.
Added a new module called system which enables the definition of domain
name, dns servers, ntp servers, nis domain and nis servers per interface.
essidnet and dhcp helpers have been re-coded around this module.

Fixed ifconfig and iproute2 erroring from new lo code - fixes #88006
If /proc/net/netlink does not exist then iproute2 will fail the
check_installed function with an appropriate error - Thanks to
Jeremy Huddleston for the patch.
If /proc/net/packet does not exist then wpa_supplicant will fail
check_installed function with an appropriate error
Background fixes for net.lo, udhcpc and wpa_supplicant

removed ${devnull} from net.lo and net-script modules
updated all modules not to re-direct stderr where appropriate
iwconfig and wpa_supplicant now save their current ESSID via save_options
and reload it in their pre_stops so that ${ESSID} and ${ESSIDVAR} can be
used in users custom postdown functions

RC_DAEMON_syslog_ng allows syslog-ng to be started with the specified
launcher - like valgrind or strace. Handy for debugging/auditing.
Thanks to Rob Holland for the idea.
Stopped setting ESSID in predown functions in iwconfig and wpa_supplicant
as there is no guarantee that the current ESSID is the one we started with
Also, we may not have an ESSID at all...

bridge stops removing IP addresses from bridge ports.
iwconfig no longer tries to get an ESSID from non-wireless interfaces.
ifconfig no longer errors when deleting addresses on a non-existant
interface.

rc-services.sh now does a /sbin/depscan.sh -u if we have not got
our deptree loaded
removed net_start/stop function from net.lo, bridge and bonding
net.lo now supports depend() per interface like so
depend_br0() { need net.eth0 net.eth1 }

net.lo now supports fallback_route - fixes #75676
due to bash limitations, only one fallback route is supported
cleaned up dhcp helper
iproute now appends routes instead of adding them - this allows multiple
default routes
RC_STRICT_NET_CHECKING now supports the none "option" which means
that the net service is always up

It's now possible to configure addresses and routes for the loopback
interface if required - however you cannot override our defaults
wpa_supplicant and iwconfig now loop for 5 seconds if essid is
not returned straight away
fixed depends error in run_script

removed udhcpc-* and dhclient-* helper modules and replaced them with a
generic dhcp module which caters for all interfaces and dhcp clients that
need it.
We now prefer iproute2 over ifconfig if both are installed.

macchanger defaults to setting the interface down, and then trying
with it up - fixes #71929
macchanger converts mac_${IFACE} to lowercase - fixes #73549
iproute2 now configures the interface up everytime we add an address
removed "need interface" from all modules depends as net.lo requires
interface anyway

wpa_supplicant module added
config-system now creates files as .tmp instead of .new and loads the
wpa_supplicant module if needed
ifconfig now addes aliases to devices other than eth0
dhcpcd, dhclient, pump and udhcpc now expose the dhcp_${IFACE} variable
instead of the old peer_dns_${IFACE}, peer_ntp_${IFACE}, peer_nis_${IFACE}
ones

fixed dhclient-ifconfig to look for dhclient-udhcpc-wrapper in the correct
place and changed hardcoded eth1 to ${interface} in udhcpc-ifconfig.
Fixes #73327 - thanks to Benoit Boissinot
essidnet gets the essid itself instead of relying on ${ESSID}

iproute2 does not need to create dummy interfaces for aliases
unlike ifconfig so we no longer do this
We now bring down all aliases and addresses properly
Split off some functions from net.lo into helpers.d/functions
so that our DHCP helper scripts can use them too :)
Deprecated interface specific setup in favour of a generic config
macchanger brings interface up now - fixes #71929
DHCP over VLAN now works - fixes #71860
Disabled modified function checking as it's far too expensive on CPU
and still isn't 100% reliable
When specifing a module that isn't emerged, you now get an error
telling you what to emerge
Removed -p option from the diff call used for function removal

tests for hostname (none) when sending hostname via dhcpcd, udhpc or pump
udhcpc now does correct signal handling so we can release leases and
terminate cleanly
Improved pump process detection
Rewrote udhcpc helper scripts around udhcpc and wrapped dhclient to udhcpc
scripts. This makes things much saner as udhcpc is much saner - also fixed
essidnet and ipv6 local link for them.

We no longer default a fallback to APIPA when no config is given
net.example fleshed out a bit more for dhcpcd - fixes #60845
Improved forced module handling a touch
modules_sort and modules_check_user in net.lo buffer _provides,
_before and _after in arrays to avoid shelling out

Split modules_load into smaller more managable functions in net.lo
Added modules_force option to net.lo with a big phat warning in
net.example about it potentially breaking networking
Fixed indentation problem in ifconfig

net-scripts/init.d/net.lo
- added use dependany on wlan incase we're using linux-wlan-ng drivers
fixes bug #64978
- moved start() to run_start() and stop() to run_stop()
created run() and new start()/stop() functions
this is so that we have one single entry point to localise variables
and to remove any added functions loaded by our modules
- removed redundant interface_exists() as it's provided by
ifconfig and/or iproute2
net-scripts/net.modules.d/ifconfig and iproute2
- added ifconfig_tunnel and iproute2_tunnel functions
addred gre/ipip tunnel support via the the tunnel module
- fixes bug #50765

net.lo - added get_type function to return the type of the interface
- eth, ippp, etc
ipppd, tuntap
- start() moved to pre_start() and we now test by type
this means you no longer need ifconfig_ippp0=( "isdn" "dhcp" )
as ippp0 is always an isdn device
bridge - fixed stop function and moved start() to pre_start()
and automatically start if the variable bridge_${iface} exists
net.example - fixed up documentation for changed behaviour above

In net-scripts/net.modules.d/ifconfig:
- Simplify ifconfig_is_up()
- Fix ifconfig_get_aliases_rev() to actually work... you can't
specify an interface name to ifconfig if you want to see the
aliases.
- Workaround a couple ifconfig bugs dealing with aliases
- Correct a return status in ifconfig_interface_del_addresses()

Add v-e-commands (veinfo, vbegin, etc) to sbin/functions.sh that
depend on RC_VERBOSE which defaults to no. Add --verbose to args
understood by runscript.sh.
Use veinfo and friends in net-scripts/init.d/net.lo when loading
modules since this information is confusing to users.
Always load global "modules" setting in following "modules_iface"
since this is a little easier for users to understand.

Install net.modules.d to /lib/rcscripts instead of /etc so we
don't have to deal with CONFIG_PROTECT
Fix diff code in modules_load so it can identify which functions
have been modified
Fix fallback mechanism in iface_start so that it works correctly
and doesn't report a bogus error message when trying the fallback
Get rid of need_begin trickery in iface_stop
Simplify eend processing in dhcp modules
Implement eindent, eoutdent, esetdent in functions.sh and adjust
net-scripts to use them.
Re-write einfo, ewarn, eerror, ebegin, eend, ewend to use
RC_INDENTATION and to work better on serial terminals
Remove conf.d/net.ppp0 since that is provided by net-dialup/ppp

Fix sorting of after/before/need/use variables. The arguments are
space-separated, not newline-separated, so they need to be massaged
before sorting. Sort the arguments on calling the
after/before/need/use callback rather than while sorting modules; this
should speed things up since they won't be sorted every time through
the loop in modules_load
Use some descriptive variable names in modules_load: loaded_interface,
changed_something, tmp, modnums, missingdeps. Try to avoid re-using
variables for different purposes
Don't test true or false in [[ ]], instead call them directly
Remove an unnecessary eval when setting umods
Use sort -n for sorting the modules numerically
Normalize spacing for loops: for ((var=0; ...))