summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-01-11 08:18:21 +0100
committerChristian Breunig <christian@breunig.cc>2024-01-11 08:20:14 +0100
commite5ce4222c6e9b24d276625678db7339ada0c54ef (patch)
treec8a65605234f8882b0745e910245b8598ff172d7 /python
parentd61cc9a0628be30314ff15c404e2ba0783e5a2b2 (diff)
downloadvyos-1x-e5ce4222c6e9b24d276625678db7339ada0c54ef.tar.gz
vyos-1x-e5ce4222c6e9b24d276625678db7339ada0c54ef.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.
Diffstat (limited to 'python')
-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}"!')