summaryrefslogtreecommitdiff
path: root/src/conf_mode/protocols_ospfv3.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-03-02 08:39:23 +0100
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-03-02 10:01:08 +0000
commitb798603e21faad8b6cf4d78a2900ea54703fecef (patch)
treedd277692f50d4cf7e1991f806ca0733b55476f56 /src/conf_mode/protocols_ospfv3.py
parenta2356f7418d4ba27b0cd08a7506d672514729f3a (diff)
downloadvyos-1x-b798603e21faad8b6cf4d78a2900ea54703fecef.tar.gz
vyos-1x-b798603e21faad8b6cf4d78a2900ea54703fecef.zip
ospfv3: T5717: allow metric and metric-type on redistributed routes
Example: vyos@vyos# set protocols ospfv3 redistribute bgp Possible completions: metric OSPF default metric metric-type OSPF metric type for default routes (default: 2) route-map Specify route-map name to use (cherry picked from commit ed2c288c8a9031f91acf76d20b84e2002696981c)
Diffstat (limited to 'src/conf_mode/protocols_ospfv3.py')
-rwxr-xr-xsrc/conf_mode/protocols_ospfv3.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/conf_mode/protocols_ospfv3.py b/src/conf_mode/protocols_ospfv3.py
index 5b1adce30..2c1cbfecd 100755
--- a/src/conf_mode/protocols_ospfv3.py
+++ b/src/conf_mode/protocols_ospfv3.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2021-2023 VyOS maintainers and contributors
+# Copyright (C) 2021-2024 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -85,6 +85,12 @@ def get_config(config=None):
if 'graceful_restart' not in ospfv3:
del default_values['graceful_restart']
+ for protocol in ['babel', 'bgp', 'connected', 'kernel', 'ripng', 'static']:
+ if dict_search(f'redistribute.{protocol}', ospfv3) is None:
+ del default_values['redistribute'][protocol]
+ if not bool(default_values['redistribute']):
+ del default_values['redistribute']
+
default_values.pop('interface', {})
# merge in remaining default values