From ea2a22f7844735021fb638c911527e612abfbc69 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 4 Mar 2021 21:31:25 +0100 Subject: 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. --- src/conf_mode/interfaces-tunnel.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/conf_mode/interfaces-tunnel.py') 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() -- cgit v1.2.3