From 355d403b3b492b07bfc405b7d7dfa0051a2ab7c2 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sun, 18 Nov 2018 17:52:49 +0100 Subject: T1000: partially fix the broken 6rd implementation. --- templates/interfaces/tunnel/node.def | 8 +++++++- templates/interfaces/tunnel/node.tag/6rd-prefix/node.def | 3 +-- templates/interfaces/tunnel/node.tag/6rd-relay-prefix/node.def | 3 +-- 3 files changed, 9 insertions(+), 5 deletions(-) (limited to 'templates') diff --git a/templates/interfaces/tunnel/node.def b/templates/interfaces/tunnel/node.def index c6e3b447..de5431a3 100644 --- a/templates/interfaces/tunnel/node.def +++ b/templates/interfaces/tunnel/node.def @@ -16,7 +16,13 @@ commit:expression: exec " if [ $VAR(./encapsulation/@) = gre ] && [ ! -n \"$VAR(./remote-ip/)\" ]; then \ echo \"No remote-ip configured for $VAR(@), tunnel can only be used for mGRE.\"; \ - fi; \ + fi; \ + if [ -n \"$VAR(./6rd-prefix/)\" ]; then \ + if [ $VAR(./encapsulation/@) != sit ]; then \ + echo \"6rd-prefix can only be set for SIT tunnels\"; \ + exit 1; \ + fi \ + fi; \ if [ $VAR(./encapsulation/@) != gre ] && [ ! -n \"$VAR(./remote-ip/)\" ]; then \ echo \"Must configure the tunnel remote-ip for $VAR(@)\"; \ exit 1; \ diff --git a/templates/interfaces/tunnel/node.tag/6rd-prefix/node.def b/templates/interfaces/tunnel/node.tag/6rd-prefix/node.def index 7e899d5d..c5f7f02c 100644 --- a/templates/interfaces/tunnel/node.tag/6rd-prefix/node.def +++ b/templates/interfaces/tunnel/node.tag/6rd-prefix/node.def @@ -1,9 +1,8 @@ -multi: type: ipv6net val_help: ipv6net; IPv6 address and prefix length help: 6rd network prefix -syntax:expression: exec "/opt/vyatta/sbin/valid_address $VAR(@)" +syntax:expression: exec "ipaddrcheck --verbose --is-ipv6-net $VAR(@)" create:expression: "true" update:expression: "false" ; \ diff --git a/templates/interfaces/tunnel/node.tag/6rd-relay-prefix/node.def b/templates/interfaces/tunnel/node.tag/6rd-relay-prefix/node.def index 0f877e2d..224c3b7e 100644 --- a/templates/interfaces/tunnel/node.tag/6rd-relay-prefix/node.def +++ b/templates/interfaces/tunnel/node.tag/6rd-relay-prefix/node.def @@ -1,9 +1,8 @@ -multi: type: ipv4net val_help: ipv4net; IPv4 prefix of interface for 6rd help: 6rd relay prefix -syntax:expression: exec "/opt/vyatta/sbin/valid_address $VAR(@)" +syntax:expression: exec "ipaddrcheck --verbose --is-ipv4-net $VAR(@)" create:expression: "true" update:expression: "false" ; \ -- cgit v1.2.3