diff options
author | Christian Breunig <christian@breunig.cc> | 2024-09-03 10:00:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-03 10:00:19 +0200 |
commit | b2afa78d6f006e753be1fa07a640d14fe94a0b8f (patch) | |
tree | 95a3a98b310f0920f03c0abd544f34546889e055 | |
parent | fcee3f6578806d03d5107d5cc1dac4ca873a4de2 (diff) | |
parent | 5f375c874ed32806e4cb7a1a3b34c5bf37f95afb (diff) | |
download | vyos-1x-b2afa78d6f006e753be1fa07a640d14fe94a0b8f.tar.gz vyos-1x-b2afa78d6f006e753be1fa07a640d14fe94a0b8f.zip |
Merge pull request #4025 from vyos/mergify/bp/sagitta/pr-4022
T6681: Add option for SLAAC to support suppress Interval Advertisement in RA Packets (backport #4022)
-rw-r--r-- | data/templates/router-advert/radvd.conf.j2 | 2 | ||||
-rw-r--r-- | interface-definitions/service_router-advert.xml.in | 6 | ||||
-rwxr-xr-x | smoketest/scripts/cli/test_service_router-advert.py | 29 |
3 files changed, 36 insertions, 1 deletions
diff --git a/data/templates/router-advert/radvd.conf.j2 b/data/templates/router-advert/radvd.conf.j2 index 97180d164..a83bd03ac 100644 --- a/data/templates/router-advert/radvd.conf.j2 +++ b/data/templates/router-advert/radvd.conf.j2 @@ -19,7 +19,7 @@ interface {{ iface }} { {% if iface_config.reachable_time is vyos_defined %} AdvReachableTime {{ iface_config.reachable_time }}; {% endif %} - AdvIntervalOpt {{ 'off' if iface_config.no_send_advert is vyos_defined else 'on' }}; + AdvIntervalOpt {{ 'off' if iface_config.no_send_interval is vyos_defined else 'on' }}; AdvSendAdvert {{ 'off' if iface_config.no_send_advert is vyos_defined else 'on' }}; {% if iface_config.default_lifetime is vyos_defined %} AdvDefaultLifetime {{ iface_config.default_lifetime }}; diff --git a/interface-definitions/service_router-advert.xml.in b/interface-definitions/service_router-advert.xml.in index 166a4a0cf..3fd33540a 100644 --- a/interface-definitions/service_router-advert.xml.in +++ b/interface-definitions/service_router-advert.xml.in @@ -390,6 +390,12 @@ <valueless/> </properties> </leafNode> + <leafNode name="no-send-interval"> + <properties> + <help>Do not send Advertisement Interval option in RAs</help> + <valueless/> + </properties> + </leafNode> </children> </tagNode> </children> diff --git a/smoketest/scripts/cli/test_service_router-advert.py b/smoketest/scripts/cli/test_service_router-advert.py index d1ff25a58..6dbb6add4 100755 --- a/smoketest/scripts/cli/test_service_router-advert.py +++ b/smoketest/scripts/cli/test_service_router-advert.py @@ -224,5 +224,34 @@ class TestServiceRADVD(VyOSUnitTestSHIM.TestCase): self.assertIn(tmp, config) self.assertIn('AdvValidLifetime 65528;', config) # default + def test_advsendadvert_advintervalopt(self): + ra_src = ['fe80::1', 'fe80::2'] + + self.cli_set(base_path + ['prefix', prefix]) + self.cli_set(base_path + ['no-send-advert']) + # commit changes + self.cli_commit() + + # Verify generated configuration + config = read_file(RADVD_CONF) + tmp = get_config_value('AdvSendAdvert') + self.assertEqual(tmp, 'off') + + tmp = get_config_value('AdvIntervalOpt') + self.assertEqual(tmp, 'on') + + self.cli_set(base_path + ['no-send-interval']) + # commit changes + self.cli_commit() + + # Verify generated configuration + config = read_file(RADVD_CONF) + tmp = get_config_value('AdvSendAdvert') + self.assertEqual(tmp, 'off') + + tmp = get_config_value('AdvIntervalOpt') + self.assertEqual(tmp, 'off') + + if __name__ == '__main__': unittest.main(verbosity=2) |