6rd: Select first IPv4 address from configured tunlink interface as local tunnel...
authorcyrus <cyrus@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Thu, 24 Apr 2014 09:11:44 +0000 (09:11 +0000)
committercyrus <cyrus@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Thu, 24 Apr 2014 09:11:44 +0000 (09:11 +0000)
Gives the user the control to select the correct WAN IPv4 address to be used by the 6rd tunnel when mutiple WAN interfaces are configured

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40566 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/network/ipv6/6rd/Makefile
package/network/ipv6/6rd/files/6rd.sh

index 19177f1..390e012 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=6rd
-PKG_VERSION:=6
+PKG_VERSION:=7
 PKG_RELEASE:=1
 
 include $(INCLUDE_DIR)/package.mk
index 58b16c8..db70b5a 100644 (file)
@@ -26,8 +26,13 @@ proto_6rd_setup() {
        ( proto_add_host_dependency "$cfg" 0.0.0.0 )
 
        [ -z "$ipaddr" ] && {
-               local wanif
-               if ! network_find_wan wanif || ! network_get_ipaddr ipaddr "$wanif"; then
+               local wanif="$tunlink"
+               if [ -z $wanif ] && ! network_find_wan wanif; then
+                       proto_notify_error "$cfg" "NO_WAN_LINK"
+                       return
+               fi
+
+               if ! network_get_ipaddr ipaddr "$wanif"; then
                        proto_notify_error "$cfg" "NO_WAN_LINK"
                        return
                fi