summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--interface-definitions/include/interface/interface-parameters-ttl.xml.i2
-rw-r--r--interface-definitions/interfaces-tunnel.xml.in3
-rwxr-xr-xsmoketest/scripts/cli/test_interfaces_tunnel.py8
3 files changed, 10 insertions, 3 deletions
diff --git a/interface-definitions/include/interface/interface-parameters-ttl.xml.i b/interface-definitions/include/interface/interface-parameters-ttl.xml.i
index aa7c9d27b..21a5e5cd9 100644
--- a/interface-definitions/include/interface/interface-parameters-ttl.xml.i
+++ b/interface-definitions/include/interface/interface-parameters-ttl.xml.i
@@ -1,7 +1,7 @@
<!-- include start from interface/interface-parameters-ttl.xml.i -->
<leafNode name="ttl">
<properties>
- <help>Specifies TTL value to use in outgoing packets (default: 0)</help>
+ <help>Specifies TTL value to use in outgoing packets</help>
<valueHelp>
<format>0</format>
<description>Copy value from original IP header</description>
diff --git a/interface-definitions/interfaces-tunnel.xml.in b/interface-definitions/interfaces-tunnel.xml.in
index f7af93f42..2b425f865 100644
--- a/interface-definitions/interfaces-tunnel.xml.in
+++ b/interface-definitions/interfaces-tunnel.xml.in
@@ -183,6 +183,9 @@
#include <include/interface/interface-parameters-key.xml.i>
#include <include/interface/interface-parameters-tos.xml.i>
#include <include/interface/interface-parameters-ttl.xml.i>
+ <leafNode name="ttl">
+ <defaultValue>64</defaultValue>
+ </leafNode>
</children>
</node>
<node name="ipv6">
diff --git a/smoketest/scripts/cli/test_interfaces_tunnel.py b/smoketest/scripts/cli/test_interfaces_tunnel.py
index 0c562b7d9..bbdfc2f0e 100755
--- a/smoketest/scripts/cli/test_interfaces_tunnel.py
+++ b/smoketest/scripts/cli/test_interfaces_tunnel.py
@@ -174,6 +174,7 @@ class TunnelInterfaceTest(BasicInterfaceTest.BaseTest):
gre_key = '10'
encapsulation = 'gre'
tos = '20'
+ ttl = 0
self.session.set(self._base_path + [interface, 'encapsulation', encapsulation])
self.session.set(self._base_path + [interface, 'local-ip', self.local_v4])
@@ -181,6 +182,7 @@ class TunnelInterfaceTest(BasicInterfaceTest.BaseTest):
self.session.set(self._base_path + [interface, 'parameters', 'ip', 'key', gre_key])
self.session.set(self._base_path + [interface, 'parameters', 'ip', 'tos', tos])
+ self.session.set(self._base_path + [interface, 'parameters', 'ip', 'ttl', str(ttl)])
# Check if commit is ok
self.session.commit()
@@ -191,7 +193,7 @@ class TunnelInterfaceTest(BasicInterfaceTest.BaseTest):
self.assertEqual(encapsulation, conf['linkinfo']['info_kind'])
self.assertEqual(self.local_v4, conf['linkinfo']['info_data']['local'])
self.assertEqual(remote_ip4, conf['linkinfo']['info_data']['remote'])
- self.assertEqual(0, conf['linkinfo']['info_data']['ttl'])
+ self.assertEqual(ttl, conf['linkinfo']['info_data']['ttl'])
def test_gretap_parameters_change(self):
interface = f'tun1040'
@@ -212,11 +214,13 @@ class TunnelInterfaceTest(BasicInterfaceTest.BaseTest):
self.assertEqual('gretap', conf['linkinfo']['info_kind'])
self.assertEqual(self.local_v4, conf['linkinfo']['info_data']['local'])
self.assertEqual(remote_ip4, conf['linkinfo']['info_data']['remote'])
- self.assertEqual(0, conf['linkinfo']['info_data']['ttl'])
+ # TTL uses a default value
+ self.assertEqual(64, conf['linkinfo']['info_data']['ttl'])
# Change remote ip address (inc host by 2
new_remote = inc_ip(remote_ip4, 2)
self.session.set(self._base_path + [interface, 'remote-ip', new_remote])
+
# Check if commit is ok
self.session.commit()