summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-11-06 21:00:51 +0100
committerGitHub <noreply@github.com>2023-11-06 21:00:51 +0100
commit7b7d422e11b14989591d6847b59062b13f98d7b9 (patch)
tree06f482f2257f21425d9981d2fe2b8e3548ff35fc
parent148ab6c4382be62c1021ec49e3262de66d38ab0a (diff)
parent583d007b09e653b335d933014803b4cdb4a91060 (diff)
downloadvyos-1x-7b7d422e11b14989591d6847b59062b13f98d7b9.tar.gz
vyos-1x-7b7d422e11b14989591d6847b59062b13f98d7b9.zip
Merge pull request #2443 from vyos/mergify/bp/sagitta/pr-2439
vxlan: T3700: add bridge dependency call when altering member interfaces (backport #2439)
-rw-r--r--data/config-mode-dependencies/vyos-1x.json3
-rwxr-xr-xsrc/conf_mode/interfaces-bridge.py18
2 files changed, 19 insertions, 2 deletions
diff --git a/data/config-mode-dependencies/vyos-1x.json b/data/config-mode-dependencies/vyos-1x.json
index 4b24420e6..948aab3a6 100644
--- a/data/config-mode-dependencies/vyos-1x.json
+++ b/data/config-mode-dependencies/vyos-1x.json
@@ -4,6 +4,9 @@
"interfaces_bonding": {
"ethernet": ["interfaces-ethernet"]
},
+ "interfaces_bridge": {
+ "vxlan": ["interfaces-vxlan"]
+ },
"pki": {
"ethernet": ["interfaces-ethernet"],
"openvpn": ["interfaces-openvpn"],
diff --git a/src/conf_mode/interfaces-bridge.py b/src/conf_mode/interfaces-bridge.py
index c82f01e53..31508a3c5 100755
--- a/src/conf_mode/interfaces-bridge.py
+++ b/src/conf_mode/interfaces-bridge.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2019-2020 VyOS maintainers and contributors
+# Copyright (C) 2019-2023 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -28,7 +28,8 @@ from vyos.configverify import verify_vrf
from vyos.ifconfig import BridgeIf
from vyos.configdict import has_address_configured
from vyos.configdict import has_vrf_configured
-
+from vyos.configdep import set_dependents
+from vyos.configdep import call_dependents
from vyos.utils.dict import dict_search
from vyos import ConfigError
@@ -83,6 +84,12 @@ def get_config(config=None):
if 'enable_vlan' in bridge and tmp:
bridge['member']['interface'][interface].update({'has_vlan' : ''})
+ # When using VXLAN member interfaces that are configured for Single
+ # VXLAN Device (SVD) we need to call the VXLAN conf-mode script to re-create
+ # VLAN to VNI mappings if required
+ if interface.startswith('vxlan'):
+ set_dependents('vxlan', conf, interface)
+
# delete empty dictionary keys - no need to run code paths if nothing is there to do
if 'member' in bridge:
if 'interface' in bridge['member'] and len(bridge['member']['interface']) == 0:
@@ -159,6 +166,13 @@ def apply(bridge):
else:
br.update(bridge)
+ for interface in dict_search('member.interface', bridge) or []:
+ if interface.startswith('vxlan'):
+ try:
+ call_dependents()
+ except ConfigError:
+ raise ConfigError('Error in updating VXLAN interface after changing bridge!')
+
return None
if __name__ == '__main__':