diff options
author | Christian Breunig <christian@breunig.cc> | 2024-01-11 16:17:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-11 16:17:33 +0100 |
commit | ebf8c8d750357122023a0c96b41072065f755c2e (patch) | |
tree | 9d8ce1ce1d6a64466114feeba21c3def5b31a7b8 /python | |
parent | f5b19352a4bc641fe773c09ec84a361404881458 (diff) | |
parent | 8c941e316035e56757d77b782cf39702c73546e0 (diff) | |
download | vyos-1x-ebf8c8d750357122023a0c96b41072065f755c2e.tar.gz vyos-1x-ebf8c8d750357122023a0c96b41072065f755c2e.zip |
Merge pull request #2798 from c-po/ipsec-T5918
T5791: T5918: use genetic pattern to detect dynamic interfaces for ipsec and dynamic dns
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/configverify.py | 7 |
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}"!') |