summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-07-16 21:51:06 +0200
committerGitHub <noreply@github.com>2020-07-16 21:51:06 +0200
commit7291da42df3b52b36d748d8f6c86e5530b998ff6 (patch)
tree6683bbc7f0cc1b155176eda317900966b6283354 /src/conf_mode
parent305c0910f08c8b6772be0247cfc03fa0282478c8 (diff)
parentf595f6fd817c8f1396240eee3eeebfaa133aaaaf (diff)
downloadvyos-1x-7291da42df3b52b36d748d8f6c86e5530b998ff6.tar.gz
vyos-1x-7291da42df3b52b36d748d8f6c86e5530b998ff6.zip
Merge pull request #501 from srividya0208/new_change
pseudo-ethernet: T2626: Fix for changing interface mode
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/interfaces-pseudo-ethernet.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/conf_mode/interfaces-pseudo-ethernet.py b/src/conf_mode/interfaces-pseudo-ethernet.py
index 70710e97c..fb8237bee 100755
--- a/src/conf_mode/interfaces-pseudo-ethernet.py
+++ b/src/conf_mode/interfaces-pseudo-ethernet.py
@@ -36,7 +36,7 @@ default_config_data = {
'ip_arp_cache_tmo': 30,
'ip_proxy_arp_pvlan': 0,
'source_interface': '',
- 'source_interface_changed': False,
+ 'recreating_required': False,
'mode': 'private',
'vif_s': {},
'vif_s_remove': [],
@@ -79,11 +79,14 @@ def get_config():
peth['source_interface'] = conf.return_value(['source-interface'])
tmp = conf.return_effective_value(['source-interface'])
if tmp != peth['source_interface']:
- peth['source_interface_changed'] = True
+ peth['recreating_required'] = True
# MACvlan mode
if conf.exists(['mode']):
peth['mode'] = conf.return_value(['mode'])
+ tmp = conf.return_effective_value(['mode'])
+ if tmp != peth['mode']:
+ peth['recreating_required'] = True
add_to_dict(conf, disabled, peth, 'vif', 'vif')
add_to_dict(conf, disabled, peth, 'vif-s', 'vif_s')
@@ -139,10 +142,10 @@ def apply(peth):
return None
# Check if MACVLAN interface already exists. Parameters like the underlaying
- # source-interface device can not be changed on the fly and the interface
+ # source-interface device or mode can not be changed on the fly and the interface
# needs to be recreated from the bottom.
if peth['intf'] in interfaces():
- if peth['source_interface_changed']:
+ if peth['recreating_required']:
MACVLANIf(peth['intf']).remove()
# MACVLAN interface needs to be created on-block instead of passing a ton