summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2023-12-05 19:55:57 +0000
committerGitHub <noreply@github.com>2023-12-05 19:55:57 +0000
commit99c674cdf6147a69fd57b4151886ff42917caeec (patch)
tree143e2d3ccbd75fd44bbee2133639f905cfcca961 /src/conf_mode
parent24b9ceb04049694a13d1fe23c76e267e335b948e (diff)
parent24a1a70596fafdd35d88506159e6cb9cd94e7a66 (diff)
downloadvyos-1x-99c674cdf6147a69fd57b4151886ff42917caeec.tar.gz
vyos-1x-99c674cdf6147a69fd57b4151886ff42917caeec.zip
Merge pull request #2574 from nicolas-fort/T5779
T5779: conntrack: Apply fixes to <set system conntrack timeout custom>
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/conntrack.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/conf_mode/conntrack.py b/src/conf_mode/conntrack.py
index 4cece6921..7f6c71440 100755
--- a/src/conf_mode/conntrack.py
+++ b/src/conf_mode/conntrack.py
@@ -159,6 +159,13 @@ def verify(conntrack):
if not group_obj:
Warning(f'{error_group} "{group_name}" has no members!')
+ if dict_search_args(conntrack, 'timeout', 'custom', inet, 'rule') != None:
+ for rule, rule_config in conntrack['timeout']['custom'][inet]['rule'].items():
+ if 'protocol' not in rule_config:
+ raise ConfigError(f'Conntrack custom timeout rule {rule} requires protocol tcp or udp')
+ else:
+ if 'tcp' in rule_config['protocol'] and 'udp' in rule_config['protocol']:
+ raise ConfigError(f'conntrack custom timeout rule {rule} - Cant use both tcp and udp protocol')
return None
def generate(conntrack):