summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-tunnel.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-10-20 21:20:17 +0200
committerChristian Poessinger <christian@poessinger.com>2021-10-20 21:21:08 +0200
commit69aa8ca0aa93575c3758c9d6a86c37159848116c (patch)
treece0eb56c208689bd3b58952fcc084f3d982f4765 /src/conf_mode/interfaces-tunnel.py
parent41f286ac9169ac6061652888d06284a75db9e83a (diff)
downloadvyos-1x-69aa8ca0aa93575c3758c9d6a86c37159848116c.tar.gz
vyos-1x-69aa8ca0aa93575c3758c9d6a86c37159848116c.zip
tunnel: T3921: bugfix KeyError for source-address
(cherry picked from commit 1312068cb9743dd4d16edd37dbed9c142724997e)
Diffstat (limited to 'src/conf_mode/interfaces-tunnel.py')
-rwxr-xr-xsrc/conf_mode/interfaces-tunnel.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/conf_mode/interfaces-tunnel.py b/src/conf_mode/interfaces-tunnel.py
index 51127127d..da8624202 100755
--- a/src/conf_mode/interfaces-tunnel.py
+++ b/src/conf_mode/interfaces-tunnel.py
@@ -98,7 +98,7 @@ def verify(tunnel):
# If tunnel source address any and key not set
if tunnel['encapsulation'] in ['gre'] and \
- tunnel['source_address'] == '0.0.0.0' and \
+ dict_search('source_address', tunnel) == '0.0.0.0' and \
dict_search('parameters.ip.key', tunnel) == None:
raise ConfigError('Tunnel parameters ip key must be set!')
@@ -111,7 +111,7 @@ def verify(tunnel):
# no match on encapsulation - bail out
if dict_search('linkinfo.info_kind', tunnel_cfg) != tunnel['encapsulation']:
continue
- new_source_address = tunnel['source_address']
+ new_source_address = dict_search('source_address', tunnel)
# Convert tunnel key to ip key, format "ip -j link show"
# 1 => 0.0.0.1, 999 => 0.0.3.231
orig_new_key = dict_search('parameters.ip.key', tunnel)