diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-03-04 21:31:25 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-03-06 10:07:05 +0100 |
commit | a7301da66ab4b52c2a1c1a562d75b0def63ff93a (patch) | |
tree | 778f3ea86052399cb7f4a2a3bf54fc56b7f7a0fa /src/conf_mode | |
parent | bab4537ae4c64dd622e69b43c97b79e8e6e63863 (diff) | |
download | vyos-1x-a7301da66ab4b52c2a1c1a562d75b0def63ff93a.tar.gz vyos-1x-a7301da66ab4b52c2a1c1a562d75b0def63ff93a.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.
(cherry picked from commit ea2a22f7844735021fb638c911527e612abfbc69)
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 d1d3616f6..e73c2b811 100755 --- a/src/conf_mode/interfaces-tunnel.py +++ b/src/conf_mode/interfaces-tunnel.py @@ -130,10 +130,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 == 'gretap': + 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() |