diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2012-01-13 15:54:10 -0800 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2012-01-13 15:57:22 -0800 |
commit | 380752f4e0726ecd5267fc3d86b87923714c6d07 (patch) | |
tree | 5a7c660dcee847efeeb9af203314bffe77ee563b /init.d | |
parent | e7649f117af827a855baeaa2fc72a5cf1a09f31c (diff) | |
download | openrc-380752f4e0726ecd5267fc3d86b87923714c6d07.tar.gz openrc-380752f4e0726ecd5267fc3d86b87923714c6d07.tar.bz2 openrc-380752f4e0726ecd5267fc3d86b87923714c6d07.tar.xz |
net: allow parameters to a single address config
In the case of a single line of configuration, where the address has
parameters, the parameters were being treated as seperate addresses.
Eg:
config_eth0="4321:0:1:2:3:4:567:89ab/64 nodad home preferred_lft 0"
Also document usage of parameters in the net example, and note that
multiple addresses on a single line cannot be mixed with parameters.
Newlines are required to seperate the addresses.
X-Gentoo-Bug: 398827
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=398827
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'init.d')
-rw-r--r-- | init.d/net.lo.in | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/init.d/net.lo.in b/init.d/net.lo.in index 2913561..9fdeaba 100644 --- a/init.d/net.lo.in +++ b/init.d/net.lo.in @@ -431,16 +431,18 @@ _load_config() set -- ${config} # We should support a space separated array for cidr configs + # But only as long as they do not contain other parameters for the address if [ $# = 1 ]; then unset IFS set -- ${config} # Of course, we may have a single address added old style. - case "$2" in - netmask|broadcast|brd|brd+|peer|pointopoint) - local IFS="$__IFS" - set -- ${config} - ;; - esac + # If the NEXT argument is a v4 or v6 address, it's the next config. + # Otherwise, it's arguments to the first config... + if [ "${2#*.*}" = "${2}" -a "${2#*:*}" = "${2}" ]; then + # Not an IPv4/IPv6 + local IFS="$__IFS" + set -- ${config} + fi fi # Ensure that loopback has the correct address |