diff options
author | Vasilis Tsiligiannis <acinonyx@openwrt.gr> | 2011-09-12 21:07:00 +0000 |
---|---|---|
committer | Vasilis Tsiligiannis <acinonyx@openwrt.gr> | 2011-09-12 21:07:00 +0000 |
commit | 718c8ab94078a7bc23c28da1abdde5b9f2665210 (patch) | |
tree | a63d94c14847c45ca240089a30bdb8ed0eaa1d06 /package/base-files/files/lib/network/config.sh | |
parent | 1bdf65f580b50bacc4637abbb3409546e92653e9 (diff) | |
download | master-31e0f0ae-718c8ab94078a7bc23c28da1abdde5b9f2665210.tar.gz master-31e0f0ae-718c8ab94078a7bc23c28da1abdde5b9f2665210.tar.bz2 master-31e0f0ae-718c8ab94078a7bc23c28da1abdde5b9f2665210.zip |
base-files: Add support for assigning multiple IPv6 addresses on an interface
SVN-Revision: 28222
Diffstat (limited to 'package/base-files/files/lib/network/config.sh')
-rwxr-xr-x | package/base-files/files/lib/network/config.sh | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/package/base-files/files/lib/network/config.sh b/package/base-files/files/lib/network/config.sh index cf5b197b59..5975f17dfc 100755 --- a/package/base-files/files/lib/network/config.sh +++ b/package/base-files/files/lib/network/config.sh @@ -242,10 +242,10 @@ setup_interface_static() { local iface="$1" local config="$2" - local ipaddr netmask ip6addr + local ipaddr netmask ip6addrs ipaddr config_get ipaddr "$config" ipaddr config_get netmask "$config" netmask - config_get ip6addr "$config" ip6addr + config_get ip6addrs "$config" ip6addr [ -z "$ipaddr" -o -z "$netmask" ] && [ -z "$ip6addr" ] && return 1 local gateway ip6gw dns bcast metric @@ -255,13 +255,14 @@ setup_interface_static() { config_get bcast "$config" broadcast config_get metric "$config" metric - case "$ip6addr" in - */*) ;; - *:*) ip6addr="$ip6addr/64" ;; - esac - [ -z "$ipaddr" ] || $DEBUG ifconfig "$iface" "$ipaddr" netmask "$netmask" broadcast "${bcast:-+}" - [ -z "$ip6addr" ] || $DEBUG ifconfig "$iface" add "$ip6addr" + for ip6addr in $ip6addrs; do + case "$ip6addr" in + */*) ;; + *:*) ip6addr="$ip6addr/64" ;; + esac + $DEBUG ifconfig "$iface" add "$ip6addr" + done [ -z "$gateway" ] || $DEBUG route add default gw "$gateway" ${metric:+metric $metric} dev "$iface" [ -z "$ip6gw" ] || $DEBUG route -A inet6 add default gw "$ip6gw" ${metric:+metric $metric} dev "$iface" [ -z "$dns" ] || add_dns "$config" $dns |