[OpenWrt-Devel] [PATCH v1] 6in4: add maxtry option to make more persistent updating HE endpoint
Kevin Darbyshire-Bryant
ldir at darbyshire-bryant.me.uk
Fri Jul 27 17:09:48 EDT 2018
Add option 'maxtry' to 6in4 interface definition. Defaults to 3.
Defines maximum number of attempts to update Hurricane Electric
tunnel endpoint address. Originally unconfigurable and hard coded to 3.
Each update attempt has a 5 second timeout.
Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
package/network/ipv6/6in4/files/6in4.sh | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/package/network/ipv6/6in4/files/6in4.sh b/package/network/ipv6/6in4/files/6in4.sh
index 941dc43d68..dce37eb3b3 100755
--- a/package/network/ipv6/6in4/files/6in4.sh
+++ b/package/network/ipv6/6in4/files/6in4.sh
@@ -31,8 +31,8 @@ proto_6in4_setup() {
local iface="$2"
local link="6in4-$cfg"
- local mtu ttl tos ipaddr peeraddr ip6addr ip6prefix ip6prefixes tunlink tunnelid username password updatekey
- json_get_vars mtu ttl tos ipaddr peeraddr ip6addr tunlink tunnelid username password updatekey
+ local mtu ttl tos ipaddr peeraddr ip6addr ip6prefix ip6prefixes tunlink tunnelid username password updatekey maxtry
+ json_get_vars mtu ttl tos ipaddr peeraddr ip6addr tunlink tunnelid username password updatekey maxtry
json_for_each_item proto_6in4_add_prefix ip6prefix ip6prefixes
[ -z "$peeraddr" ] && {
@@ -98,7 +98,7 @@ proto_6in4_setup() {
local url="$http://ipv4.tunnelbroker.net/nic/update?hostname=$tunnelid"
local try=0
- local max=3
+ local max="${maxtry:-3}"
(
set -o pipefail
@@ -134,6 +134,7 @@ proto_6in4_init_config() {
proto_config_add_string "username"
proto_config_add_string "password"
proto_config_add_string "updatekey"
+ proto_config_add_int "maxtry"
proto_config_add_int "mtu"
proto_config_add_int "ttl"
proto_config_add_string "tos"
--
2.15.2 (Apple Git-101.1)
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list