6to4: properly setup Base6to4Interface (#12251)
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 27 Sep 2012 18:30:07 +0000 (18:30 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 27 Sep 2012 18:30:07 +0000 (18:30 +0000)
SVN-Revision: 33573

package/6to4/Makefile
package/6to4/files/6to4.sh

index fdf8627a45f313d0a970086cb4fd59fc5c897d5b..f29571d86c87d4ee6ec3faa3a1bd7db254db70d7 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=6to4
-PKG_VERSION:=10
+PKG_VERSION:=11
 PKG_RELEASE:=1
 
 include $(INCLUDE_DIR)/package.mk
index f518b023329af2befc7dbf27b1e37a8254045b58..3a616f675bb609bceb6ffa2a1b5ce74f66d18e25 100755 (executable)
@@ -108,10 +108,15 @@ proto_6to4_setup() {
 
        ( proto_add_host_dependency "$cfg" 0.0.0.0 )
 
+       local wanif
+       if ! network_find_wan wanif; then
+               proto_notify_error "$cfg" "NO_WAN_LINK"
+               return
+       fi
+
        [ -z "$ipaddr" ] && {
-               local wanif
-               if ! network_find_wan wanif || ! network_get_ipaddr ipaddr "$wanif"; then
-                       proto_notify_error "$cfg" "NO_WAN_LINK"
+               if ! network_get_ipaddr ipaddr "$wanif"; then
+                       proto_notify_error "$cfg" "NO_WAN_ADDRESS"
                        return
                fi
        }
@@ -159,7 +164,7 @@ proto_6to4_setup() {
 
                        set_6to4_radvd_interface "$sid" "$adv_interface" "$mtu"
                        set_6to4_radvd_prefix    "$sid" "$adv_interface" \
-                               "$wancfg" "$(printf "0:0:0:%x::/64" $adv_subnet)" \
+                               "$wanif" "$(printf "0:0:0:%x::/64" $adv_subnet)" \
                                "$adv_valid_lifetime" "$adv_preferred_lifetime"
 
                        adv_subnets="${adv_subnets:+$adv_subnets }$adv_ifname:$subnet6"