diff mbox

[OpenWrt-Devel] Retry 6rd if wan is down

Message ID mbkeoa$26l$1@ger.gmane.org
State Rejected
Delegated to: Steven Barth
Headers show

Commit Message

Daniel Gimpelevich Feb. 13, 2015, 9:05 a.m. UTC
Currently, if you have dual WAN and the link needed for 6rd is down, it
just silently fails. This patch makes it retry in case the link comes up.

Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>

Comments

Yousong Zhou Feb. 13, 2015, 12:09 p.m. UTC | #1
On 13 February 2015 at 17:05, Daniel Gimpelevich
<daniel@gimpelevich.san-francisco.ca.us> wrote:
> Currently, if you have dual WAN and the link needed for 6rd is down, it
> just silently fails. This patch makes it retry in case the link comes up.
>
> Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
> --- a/package/network/ipv6/6rd/files/6rd.sh     (revision 44437)
> +++ b/package/network/ipv6/6rd/files/6rd.sh     (working copy)
> @@ -33,7 +33,8 @@
>                 fi
>
>                 if ! network_get_ipaddr ipaddr "$wanif"; then
> -                       proto_notify_error "$cfg" "NO_WAN_LINK"
> +                       sleep 60
> +                       proto_setup_failed "$cfg"
>                         return

A wild guess is that `return 1` or `exit 1` should do the trick.

                yousong

>                 fi
>         }
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Daniel Gimpelevich Feb. 13, 2015, 1:07 p.m. UTC | #2
On Fri, 13 Feb 2015 20:09:40 +0800, Yousong Zhou wrote:
> A wild guess is that `return 1` or `exit 1` should do the trick.
> 
>                 yousong

No, the return value is ignored.
Steven Barth Feb. 16, 2015, 8:37 a.m. UTC | #3
What does that "sleep 60" do for you here? It doesn't look very sane to me.
Daniel Gimpelevich Feb. 18, 2015, 6:48 a.m. UTC | #4
On Mon, 16 Feb 2015 09:37:18 +0100, Steven Barth wrote:
> What does that "sleep 60" do for you here? It doesn't look very sane to
> me.

Without it, it retries every couple of seconds, and that really bogs down 
the CPU.
diff mbox

Patch

--- a/package/network/ipv6/6rd/files/6rd.sh	(revision 44437)
+++ b/package/network/ipv6/6rd/files/6rd.sh	(working copy)
@@ -33,7 +33,8 @@ 
 		fi
 
 		if ! network_get_ipaddr ipaddr "$wanif"; then
-			proto_notify_error "$cfg" "NO_WAN_LINK"
+			sleep 60
+			proto_setup_failed "$cfg"
 			return
 		fi
 	}