summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-05-29 10:35:37 +0200
committerChristian Poessinger <christian@poessinger.com>2022-05-29 10:35:37 +0200
commit687462972361af3d91047721f1d7bd02da7f9dd5 (patch)
tree602e813967208822acef8b3be087a60acab4c7fc
parent939794f297728aacfbc9422b66941614f7f3cf45 (diff)
downloadvyos-1x-687462972361af3d91047721f1d7bd02da7f9dd5.tar.gz
vyos-1x-687462972361af3d91047721f1d7bd02da7f9dd5.zip
rip: T4448: remove default version for RIP
Commit f9e38622 ("rip: T4448: add support to set protocol version on an interface level") also added the versionspecified on a per interface level. the RIp version carried a default value of 2 which makes RIPv1 and RIPv2 no longer working which is dthe default for FRR. Remove the default "2" from the RIP version specifier to make this behavior work again.
-rw-r--r--interface-definitions/include/rip/version.xml.i7
-rwxr-xr-xsmoketest/scripts/cli/test_protocols_rip.py16
-rwxr-xr-xsrc/conf_mode/protocols_rip.py15
3 files changed, 11 insertions, 27 deletions
diff --git a/interface-definitions/include/rip/version.xml.i b/interface-definitions/include/rip/version.xml.i
index f7d3eab0d..a35350aee 100644
--- a/interface-definitions/include/rip/version.xml.i
+++ b/interface-definitions/include/rip/version.xml.i
@@ -1,19 +1,18 @@
<!-- include start from rip/version.xml.i -->
<leafNode name="version">
<properties>
- <help>RIP protocol version</help>
+ <help>Limit RIP protocol version</help>
<valueHelp>
<format>1</format>
- <description>RIPv1</description>
+ <description>Allow RIPv1 only</description>
</valueHelp>
<valueHelp>
<format>2</format>
- <description>RIPv2</description>
+ <description>Allow RIPv2 only</description>
</valueHelp>
<constraint>
<validator name="numeric" argument="--range 1-2"/>
</constraint>
</properties>
- <defaultValue>2</defaultValue>
</leafNode>
<!-- include end -->
diff --git a/smoketest/scripts/cli/test_protocols_rip.py b/smoketest/scripts/cli/test_protocols_rip.py
index 8c100d537..11385adb5 100755
--- a/smoketest/scripts/cli/test_protocols_rip.py
+++ b/smoketest/scripts/cli/test_protocols_rip.py
@@ -159,24 +159,24 @@ class TestProtocolsRIP(VyOSUnitTestSHIM.TestCase):
self.assertNotIn(zebra_route_map, frrconfig)
def test_rip_03_version(self):
- version = '1'
+ rx_version = '1'
+ tx_version = '2'
interface = 'eth0'
- self.cli_set(base_path + ['version', version])
- self.cli_set(base_path + ['interface', interface, 'send', 'version', version])
- self.cli_set(base_path + ['interface', interface, 'receive', 'version', version])
+ self.cli_set(base_path + ['version', tx_version])
+ self.cli_set(base_path + ['interface', interface, 'send', 'version', tx_version])
+ self.cli_set(base_path + ['interface', interface, 'receive', 'version', rx_version])
# commit changes
self.cli_commit()
# Verify FRR configuration
frrconfig = self.getFRRconfig('router rip')
- self.assertIn(f'version {version}', frrconfig)
+ self.assertIn(f'version {tx_version}', frrconfig)
frrconfig = self.getFRRconfig(f'interface {interface}')
- self.assertIn(f' ip rip receive version {version}', frrconfig)
- self.assertIn(f' ip rip send version {version}', frrconfig)
-
+ self.assertIn(f' ip rip receive version {rx_version}', frrconfig)
+ self.assertIn(f' ip rip send version {tx_version}', frrconfig)
if __name__ == '__main__':
unittest.main(verbosity=2)
diff --git a/src/conf_mode/protocols_rip.py b/src/conf_mode/protocols_rip.py
index e29b23765..c78d90396 100755
--- a/src/conf_mode/protocols_rip.py
+++ b/src/conf_mode/protocols_rip.py
@@ -56,24 +56,9 @@ def get_config(config=None):
# We have gathered the dict representation of the CLI, but there are default
# options which we need to update into the dictionary retrived.
default_values = defaults(base)
-
- # T2665: we can not blend in default values of tagNodes - delete and add
- # individual values later on ...
- if 'interface' in default_values:
- del default_values['interface']
# merge in remaining default values
rip = dict_merge(default_values, rip)
- # T2665: add individual per interface defaults
-
- # T2665: blend in per interface defaults
- if 'interface' in rip:
- default_values = defaults(base + ['interface'])
- for interface in rip['interface']:
- # merge in default values
- rip['interface'][interface] = dict_merge(default_values,
- rip['interface'][interface])
-
# We also need some additional information from the config, prefix-lists
# and route-maps for instance. They will be used in verify().
#