From d860d2f136e92c2bb959ad3c6dd9db70da0480b6 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 5 Mar 2020 17:20:30 +0100 Subject: vxlan: T1636: ensure 'link' interface really exists --- src/conf_mode/interfaces-vxlan.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/conf_mode/interfaces-vxlan.py') diff --git a/src/conf_mode/interfaces-vxlan.py b/src/conf_mode/interfaces-vxlan.py index dabfe4836..c9ef0fe9c 100755 --- a/src/conf_mode/interfaces-vxlan.py +++ b/src/conf_mode/interfaces-vxlan.py @@ -134,8 +134,11 @@ def verify(vxlan): if vxlan['mtu'] < 1500: print('WARNING: RFC7348 recommends VXLAN tunnels preserve a 1500 byte MTU') - if vxlan['group'] and not vxlan['link']: - raise ConfigError('Multicast VXLAN requires an underlaying interface ') + if vxlan['group']: + if not vxlan['link']: + raise ConfigError('Multicast VXLAN requires an underlaying interface ') + if not vxlan['link'] in interfaces(): + raise ConfigError('VXLAN source interface does not exist') if not (vxlan['group'] or vxlan['remote']): raise ConfigError('Group or remote must be configured') -- cgit v1.2.3