diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-03-04 21:31:25 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-03-04 21:31:25 +0100 |
commit | ea2a22f7844735021fb638c911527e612abfbc69 (patch) | |
tree | edf76c00cda3f2dfd446fded1e184b6d170f7082 /src/conf_mode | |
parent | d4c40adfeac4686174388878520138b640884c45 (diff) | |
download | vyos-1x-ea2a22f7844735021fb638c911527e612abfbc69.tar.gz vyos-1x-ea2a22f7844735021fb638c911527e612abfbc69.zip |
tunnel: T3381: fix error when switching from mGRE to GRE mode
Linux does not support changing the remote address from any (multipoint
GRE as used by DMVPN) to a discrete remote address. THis will return an
error: add tunnel "tun1" failed: Invalid argument
This can be handled by detecting the mGRE -> GRE change and re-create the tunnel
silently.
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/interfaces-tunnel.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/conf_mode/interfaces-tunnel.py b/src/conf_mode/interfaces-tunnel.py index 7958f61ea..b63312750 100755 --- a/src/conf_mode/interfaces-tunnel.py +++ b/src/conf_mode/interfaces-tunnel.py @@ -102,10 +102,14 @@ def apply(tunnel): # remote addresses. This returns "Operation not supported" by the Kernel. # There is no other solution to destroy and recreate the tunnel. encap = '' + remote = '' tmp = get_json_iface_options(interface) - if tmp: encap = dict_search('linkinfo.info_kind', tmp) + if tmp: + encap = dict_search('linkinfo.info_kind', tmp) + remote = dict_search('linkinfo.info_data.remote', tmp) - if 'deleted' in tunnel or 'encapsulation_changed' in tunnel or encap in ['gretap', 'ip6gretap']: + if ('deleted' in tunnel or 'encapsulation_changed' in tunnel or + encap in ['gretap', 'ip6gretap'] or remote in ['any']): if interface in interfaces(): tmp = Interface(interface) tmp.remove() |