From 8f161eaae78769e5a1d573e43f00a0f439aadc28 Mon Sep 17 00:00:00 2001
From: Christian Breunig <christian@breunig.cc>
Date: Wed, 2 Aug 2023 22:58:56 +0200
Subject: vxlan: T5429: source-interface is not honored and throws config error

cpo@leaf-02# show interfaces vxlan
+vxlan vxlan1 {
+    mtu 1500
+    parameters {
+        nolearning
+    }
+    port 4789
+    source-interface dum1
+    vni 100
+}

cpo@leaf-02# commit
[ interfaces vxlan vxlan1 ]
Group, remote or source-address must be configured

[[interfaces vxlan vxlan1]] failed

Extend verify() check to also honor source-interface definition.
---
 src/conf_mode/interfaces-vxlan.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/conf_mode/interfaces-vxlan.py b/src/conf_mode/interfaces-vxlan.py
index b1536148c..a3b0867e0 100755
--- a/src/conf_mode/interfaces-vxlan.py
+++ b/src/conf_mode/interfaces-vxlan.py
@@ -87,8 +87,8 @@ def verify(vxlan):
             raise ConfigError('Multicast VXLAN requires an underlaying interface')
         verify_source_interface(vxlan)
 
-    if not any(tmp in ['group', 'remote', 'source_address'] for tmp in vxlan):
-        raise ConfigError('Group, remote or source-address must be configured')
+    if not any(tmp in ['group', 'remote', 'source_address', 'source_interface'] for tmp in vxlan):
+        raise ConfigError('Group, remote, source-address or source-interface must be configured')
 
     if 'vni' not in vxlan and 'external' not in vxlan:
         raise ConfigError(
-- 
cgit v1.2.3