summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-pseudo-ethernet.py
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2022-09-15 15:22:05 +0100
committerGitHub <noreply@github.com>2022-09-15 15:22:05 +0100
commit435016fdb353b79577c40baa23af8e01fcadd098 (patch)
tree12b9acdc00ba63041b96d54bdeb339c3264959dd /src/conf_mode/interfaces-pseudo-ethernet.py
parente57146723fd791d71ac9659f9247a8827c151c97 (diff)
parent87894a2fa32933400a930783edcce74a8b4792a4 (diff)
downloadvyos-1x-435016fdb353b79577c40baa23af8e01fcadd098.tar.gz
vyos-1x-435016fdb353b79577c40baa23af8e01fcadd098.zip
Merge pull request #1519 from c-po/t4630-equuleus-peth-macsec
T4630: disallow same source-interface for macsec and pseudo-ethernet
Diffstat (limited to 'src/conf_mode/interfaces-pseudo-ethernet.py')
-rwxr-xr-xsrc/conf_mode/interfaces-pseudo-ethernet.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/conf_mode/interfaces-pseudo-ethernet.py b/src/conf_mode/interfaces-pseudo-ethernet.py
index 4bd75f770..48e62a345 100755
--- a/src/conf_mode/interfaces-pseudo-ethernet.py
+++ b/src/conf_mode/interfaces-pseudo-ethernet.py
@@ -19,6 +19,7 @@ from sys import exit
from vyos.config import Config
from vyos.configdict import get_interface_dict
from vyos.configdict import leaf_node_changed
+from vyos.configdict import is_source_interface
from vyos.configverify import verify_vrf
from vyos.configverify import verify_address
from vyos.configverify import verify_bridge_delete
@@ -49,6 +50,10 @@ def get_config(config=None):
if 'source_interface' in peth:
peth['parent'] = get_interface_dict(conf, ['interfaces', 'ethernet'],
peth['source_interface'])
+ # test if source-interface is maybe already used by another interface
+ tmp = is_source_interface(conf, peth['source_interface'], ['macsec'])
+ if tmp and tmp != peth['ifname']: peth.update({'is_source_interface' : tmp})
+
return peth
def verify(peth):