diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2012-07-02 12:14:50 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2012-07-02 12:14:50 +0000 |
commit | 56c77e6d507c151b5042164dcdb03463b2869ab1 (patch) | |
tree | 3fcdb0361d8d8e5f44929fcfb1e936238363cdb8 /package/6to4 | |
parent | ee808f12b2743febfbe40c5271a128b6bdb8d575 (diff) | |
download | upstream-56c77e6d507c151b5042164dcdb03463b2869ab1.tar.gz upstream-56c77e6d507c151b5042164dcdb03463b2869ab1.tar.bz2 upstream-56c77e6d507c151b5042164dcdb03463b2869ab1.zip |
[package] 6to4: fix ifname resolving for adv_interface option (#11796)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32576 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/6to4')
-rw-r--r-- | package/6to4/Makefile | 2 | ||||
-rwxr-xr-x | package/6to4/files/6to4.sh | 23 |
2 files changed, 11 insertions, 14 deletions
diff --git a/package/6to4/Makefile b/package/6to4/Makefile index 740697f75e..fdf8627a45 100644 --- a/package/6to4/Makefile +++ b/package/6to4/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=6to4 -PKG_VERSION:=9 +PKG_VERSION:=10 PKG_RELEASE:=1 include $(INCLUDE_DIR)/package.mk diff --git a/package/6to4/files/6to4.sh b/package/6to4/files/6to4.sh index 10abd9a26e..f518b02332 100755 --- a/package/6to4/files/6to4.sh +++ b/package/6to4/files/6to4.sh @@ -143,7 +143,6 @@ proto_6to4_setup() { uci_revert_state radvd config_load radvd - config_load network adv_subnet=$((0x${adv_subnet:-1})) @@ -151,22 +150,20 @@ proto_6to4_setup() { for adv_interface in ${adv_interface:-lan}; do local adv_ifname - config_get adv_ifname "${adv_interface:-lan}" ifname + network_get_device adv_ifname "${adv_interface:-lan}" || continue - grep -qs "^ *$adv_ifname:" /proc/net/dev && { - local subnet6="$(printf "%s:%x::1/64" "$prefix6" $adv_subnet)" + local subnet6="$(printf "%s:%x::1/64" "$prefix6" $adv_subnet)" - logger -t "$link" " * Advertising IPv6 subnet $subnet6 on ${adv_interface:-lan} ($adv_ifname)" - ip -6 addr add $subnet6 dev $adv_ifname + logger -t "$link" " * Advertising IPv6 subnet $subnet6 on ${adv_interface:-lan} ($adv_ifname)" + ip -6 addr add $subnet6 dev $adv_ifname - set_6to4_radvd_interface "$sid" "$adv_interface" "$mtu" - set_6to4_radvd_prefix "$sid" "$adv_interface" \ - "$wancfg" "$(printf "0:0:0:%x::/64" $adv_subnet)" \ - "$adv_valid_lifetime" "$adv_preferred_lifetime" + set_6to4_radvd_interface "$sid" "$adv_interface" "$mtu" + set_6to4_radvd_prefix "$sid" "$adv_interface" \ + "$wancfg" "$(printf "0:0:0:%x::/64" $adv_subnet)" \ + "$adv_valid_lifetime" "$adv_preferred_lifetime" - adv_subnets="${adv_subnets:+$adv_subnets }$adv_ifname:$subnet6" - adv_subnet=$(($adv_subnet + 1)) - } + adv_subnets="${adv_subnets:+$adv_subnets }$adv_ifname:$subnet6" + adv_subnet=$(($adv_subnet + 1)) done uci_set_state network "$cfg" adv_subnets "$adv_subnets" |