summaryrefslogtreecommitdiff
path: root/python/vyos/configverify.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-01-11 08:18:21 +0100
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-01-11 15:18:19 +0000
commit900289cf5d94cfc2dbb59cad548efb126389bbf9 (patch)
tree7011f65a1de9b35c9ba2bfd5783dcc2f2a67fef5 /python/vyos/configverify.py
parentaa90d124d772efee6c4c5f3a9ccc734fe20ae03b (diff)
downloadvyos-1x-900289cf5d94cfc2dbb59cad548efb126389bbf9.tar.gz
vyos-1x-900289cf5d94cfc2dbb59cad548efb126389bbf9.zip
dns: T5791: use common pattern for exclude check of dynamic interfaces
This uses a more common pattern froma base class while the original code from 0a1c9bc38 ("T5791: DNS dynamic exclude check for dynamic interfaces PPPoE") is still retained. (cherry picked from commit e5ce4222c6e9b24d276625678db7339ada0c54ef)
Diffstat (limited to 'python/vyos/configverify.py')
-rw-r--r--python/vyos/configverify.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py
index 85423142d..5d3723876 100644
--- a/python/vyos/configverify.py
+++ b/python/vyos/configverify.py
@@ -1,4 +1,4 @@
-# Copyright 2020-2023 VyOS maintainers and contributors <maintainers@vyos.io>
+# Copyright 2020-2024 VyOS maintainers and contributors <maintainers@vyos.io>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -25,6 +25,9 @@ from vyos import ConfigError
from vyos.utils.dict import dict_search
from vyos.utils.dict import dict_search_recursive
+# pattern re-used in ipsec migration script
+dynamic_interface_pattern = r'(ppp|pppoe|sstpc|l2tp|ipoe)[0-9]+'
+
def verify_mtu(config):
"""
Common helper function used by interface implementations to perform
@@ -290,7 +293,7 @@ def verify_source_interface(config):
src_ifname = config['source_interface']
# We do not allow sourcing other interfaces (e.g. tunnel) from dynamic interfaces
- tmp = re.compile(r'(ppp|pppoe|sstpc|l2tp|ipoe)[0-9]+')
+ tmp = re.compile(dynamic_interface_pattern)
if tmp.match(src_ifname):
raise ConfigError(f'Can not source "{ifname}" from dynamic interface "{src_ifname}"!')