summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-03-26 07:31:46 +0100
committerChristian Poessinger <christian@poessinger.com>2020-03-26 07:32:55 +0100
commit583e9d907236a4a98fe40e97a378c1fb655f8a95 (patch)
treecfc58842d0a8eaff6946c14317ed1ba86a0d1c4f
parent1dec776850781279866a65c1b2d6a09ae218b874 (diff)
downloadvyos-1x-583e9d907236a4a98fe40e97a378c1fb655f8a95.tar.gz
vyos-1x-583e9d907236a4a98fe40e97a378c1fb655f8a95.zip
router-advert: T2162: bugfix migrating link-mtu nodes with 0 value
... those nodes mean link-mtu advertisement is disabled in radvd and thus we delete the node completely as it's useless.
-rwxr-xr-xsrc/conf_mode/service-router-advert.py4
-rwxr-xr-xsrc/migration-scripts/interfaces/5-to-68
2 files changed, 11 insertions, 1 deletions
diff --git a/src/conf_mode/service-router-advert.py b/src/conf_mode/service-router-advert.py
index 5ae719c29..1e0d28397 100755
--- a/src/conf_mode/service-router-advert.py
+++ b/src/conf_mode/service-router-advert.py
@@ -42,7 +42,9 @@ interface {{ i.name }} {
{% if i.default_lifetime %}
AdvDefaultLifetime {{ i.default_lifetime }};
{% endif %}
+{% if i.link_mtu %}
AdvLinkMTU {{ i.link_mtu }};
+{% endif %}
AdvOtherConfigFlag {{ i.other_config_flag }};
AdvRetransTimer {{ i.retrans_timer }};
AdvCurHopLimit {{ i.hop_limit }};
@@ -81,7 +83,7 @@ def get_config():
'default_lifetime': '',
'default_preference': 'medium',
'dnssl': [],
- 'link_mtu': '0',
+ 'link_mtu': '',
'managed_flag': 'off',
'interval_max': '600',
'interval_min': '',
diff --git a/src/migration-scripts/interfaces/5-to-6 b/src/migration-scripts/interfaces/5-to-6
index 9dbfd30e1..85a1994c6 100755
--- a/src/migration-scripts/interfaces/5-to-6
+++ b/src/migration-scripts/interfaces/5-to-6
@@ -75,6 +75,14 @@ def copy_rtradv(c, old_base, interface):
if tmp == 'false':
c.set(new_base + ['no-send-advert'])
+ # link-mtu advertisement was formerly disabled by setting its value to 0
+ # ... this makes less sense - if it should not be send, just do not
+ # configure it
+ if c.exists(new_base + ['link-mtu']):
+ tmp = c.return_value(new_base + ['link-mtu'])
+ if tmp == '0':
+ c.delete(new_base + ['link-mtu'])
+
if __name__ == '__main__':
if (len(sys.argv) < 1):
print("Must specify file name!")