From 94ab5fc768dea1b78e50bddb7c73e6ddb971b9c6 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Thu, 12 Nov 2026 17:41:31 +0100 Subject: ospf: T9606: move "parameters rfc1583-compatibility" to "compatible rfc1583" The RFC1583 option sat under "parameters" although FRR groups it with its other "compatible" commands. It now lives under "compatible rfc1583" for the default and VRF instances. Migration moves an existing setting and drops a "parameters" node left empty by the move. --- .../include/ospf/protocol-common-config.xml.i | 19 +++++++++++++------ .../include/version/ospf-version.xml.i | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'interface-definitions') diff --git a/interface-definitions/include/ospf/protocol-common-config.xml.i b/interface-definitions/include/ospf/protocol-common-config.xml.i index d11178135..175b6e2f1 100644 --- a/interface-definitions/include/ospf/protocol-common-config.xml.i +++ b/interface-definitions/include/ospf/protocol-common-config.xml.i @@ -334,6 +334,19 @@ + + + OSPF compatibility list + + + + + Enable RFC1583 criteria for handling AS external routes + + + + + #include @@ -635,12 +648,6 @@ cisco - - - Enable RFC1583 criteria for handling AS external routes - - - #include diff --git a/interface-definitions/include/version/ospf-version.xml.i b/interface-definitions/include/version/ospf-version.xml.i index 8ba074e81..3adb84b82 100644 --- a/interface-definitions/include/version/ospf-version.xml.i +++ b/interface-definitions/include/version/ospf-version.xml.i @@ -1,3 +1,3 @@ - + -- cgit v1.2.3 From bffa7c48f7e8724c1fba21cbb32a7b8ab0d40def Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Thu, 12 Nov 2026 17:41:36 +0100 Subject: ospf: T9606: add "compatible rfc7474" to control strict sequence number validation FRR now makes strict RFC7474 sequence number validation for OSPF cryptographic authentication optional. It is on by default and only the "no compatible rfc7474" form is shown. The new CLI node "compatible rfc7474" enables strict validation. When it is not set, "no compatible rfc7474" is rendered. Migration does not set it, so the previous behaviour of non-strict sequence number validation is kept on upgraded routers. Users must explicitly enable strict validation. --- data/templates/frr/ospfd.frr.j2 | 4 ++ .../include/ospf/protocol-common-config.xml.i | 6 +++ smoketest/scripts/cli/test_protocols_ospf.py | 48 ++++++++++++++++++++++ 3 files changed, 58 insertions(+) (limited to 'interface-definitions') diff --git a/data/templates/frr/ospfd.frr.j2 b/data/templates/frr/ospfd.frr.j2 index fcd969d28..2d62e205c 100644 --- a/data/templates/frr/ospfd.frr.j2 +++ b/data/templates/frr/ospfd.frr.j2 @@ -214,6 +214,10 @@ router ospf {{ 'vrf ' ~ vrf if vrf is vyos_defined }} {% if compatible.rfc1583 is vyos_defined %} compatible rfc1583 {% endif %} +{# FRR enables RFC7474 by default and only prints the "no" form #} +{% if compatible.rfc7474 is not vyos_defined %} + no compatible rfc7474 +{% endif %} {% if parameters.router_id is vyos_defined %} ospf router-id {{ parameters.router_id }} {% endif %} diff --git a/interface-definitions/include/ospf/protocol-common-config.xml.i b/interface-definitions/include/ospf/protocol-common-config.xml.i index 175b6e2f1..ec06c3827 100644 --- a/interface-definitions/include/ospf/protocol-common-config.xml.i +++ b/interface-definitions/include/ospf/protocol-common-config.xml.i @@ -345,6 +345,12 @@ + + + Enable strict RFC7474 sequence number validation for cryptographic authentication + + + #include diff --git a/smoketest/scripts/cli/test_protocols_ospf.py b/smoketest/scripts/cli/test_protocols_ospf.py index 07e6b9c46..5ea9c8fae 100755 --- a/smoketest/scripts/cli/test_protocols_ospf.py +++ b/smoketest/scripts/cli/test_protocols_ospf.py @@ -75,6 +75,7 @@ class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase): self.assertIn(f'router ospf', frrconfig) self.assertIn(f' auto-cost reference-bandwidth 100', frrconfig) self.assertIn(f' timers throttle spf 200 1000 10000', frrconfig) # defaults + self.assertIn(f' no compatible rfc7474', frrconfig) def test_ospf_02_simple(self): router_id = '127.0.0.1' @@ -816,5 +817,52 @@ class TestProtocolsOSPF(VyOSUnitTestSHIM.TestCase): self.cli_delete(vrf_base) + def test_ospf_24_compatible(self): + # FRR enables "compatible rfc7474" by default and prints only the + # "no" form - rendered when the CLI node is not set + vrf = 'blue' + vrf_base = ['vrf', 'name', vrf] + instances = { + 'router ospf': base_path, + f'router ospf vrf {vrf}': vrf_base + base_path, + } + + def verify(rfc1583: bool, rfc7474: bool): + for header in instances: + frrconfig = self.getFRRconfig(header, stop_section='^exit') + self.assertIn(' ospf router-id 192.0.2.1', frrconfig) + if rfc1583: + self.assertIn(' compatible rfc1583', frrconfig) + else: + self.assertNotIn(' compatible rfc1583', frrconfig) + self.assertNotRegex(frrconfig, r'(?m)^ compatible rfc7474$') + if rfc7474: + self.assertNotIn(' no compatible rfc7474', frrconfig) + else: + self.assertIn(' no compatible rfc7474', frrconfig) + + self.cli_set(vrf_base + ['table', '1000']) + for path in instances.values(): + self.cli_set(path + ['parameters', 'router-id', '192.0.2.1']) + self.cli_commit() + verify(rfc1583=False, rfc7474=False) + + for path in instances.values(): + self.cli_set(path + ['compatible', 'rfc7474']) + self.cli_commit() + verify(rfc1583=False, rfc7474=True) + + for path in instances.values(): + self.cli_set(path + ['compatible', 'rfc1583']) + self.cli_commit() + verify(rfc1583=True, rfc7474=True) + + for path in instances.values(): + self.cli_delete(path + ['compatible']) + self.cli_commit() + verify(rfc1583=False, rfc7474=False) + + self.cli_delete(vrf_base) + if __name__ == '__main__': unittest.main(verbosity=2, failfast=VyOSUnitTestSHIM.TestCase.debug_on()) -- cgit v1.2.3