summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-01-12 19:40:42 +0100
committerGitHub <noreply@github.com>2023-01-12 19:40:42 +0100
commit521fef5f0aded11e2341fe893ecf4b1a206dcfc2 (patch)
tree9af2913a50138003a93cb9360b43f81912320389 /src
parent0b59afbb9fd06abf87ed340f05b977e52e516266 (diff)
parent01386606982352de7eb51f55acc11c6a58ed4cef (diff)
downloadvyos-1x-521fef5f0aded11e2341fe893ecf4b1a206dcfc2.tar.gz
vyos-1x-521fef5f0aded11e2341fe893ecf4b1a206dcfc2.zip
Merge pull request #1752 from sever-sever/T4118
T4118: Add default value any for connection remote-id
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/vpn_ipsec.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/conf_mode/vpn_ipsec.py b/src/conf_mode/vpn_ipsec.py
index b79e9847a..3af2af4d9 100755
--- a/src/conf_mode/vpn_ipsec.py
+++ b/src/conf_mode/vpn_ipsec.py
@@ -95,6 +95,7 @@ def get_config(config=None):
del default_values['esp_group']
del default_values['ike_group']
del default_values['remote_access']
+ del default_values['site_to_site']
ipsec = dict_merge(default_values, ipsec)
if 'esp_group' in ipsec:
@@ -143,6 +144,14 @@ def get_config(config=None):
ipsec['remote_access']['radius']['server'][server] = dict_merge(default_values,
ipsec['remote_access']['radius']['server'][server])
+ # XXX: T2665: we can not safely rely on the defaults() when there are
+ # tagNodes in place, it is better to blend in the defaults manually.
+ if dict_search('site_to_site.peer', ipsec):
+ default_values = defaults(base + ['site-to-site', 'peer'])
+ for peer in ipsec['site_to_site']['peer']:
+ ipsec['site_to_site']['peer'][peer] = dict_merge(default_values,
+ ipsec['site_to_site']['peer'][peer])
+
ipsec['dhcp_no_address'] = {}
ipsec['install_routes'] = 'no' if conf.exists(base + ["options", "disable-route-autoinstall"]) else default_install_routes
ipsec['interface_change'] = leaf_node_changed(conf, base + ['interface'])