summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-10-17 20:55:12 +0200
committerChristian Breunig <christian@breunig.cc>2026-10-17 20:56:35 +0200
commitdb494f512ae62eab3d90b786da5f8d855b45ec7d (patch)
treebaff2baec1b75f5f16a68a1f25061fb5525f7d1c /python
parente71bb87517cec1818714f4dd7199a524494c1949 (diff)
downloadvyos-1x-db494f512ae62eab3d90b786da5f8d855b45ec7d.tar.gz
vyos-1x-db494f512ae62eab3d90b786da5f8d855b45ec7d.zip
wlb: T9472: honour limit threshold "above" on rules
"limit threshold above" was ignored. The rule always matched the traffic below the rate, the same as the default "below". With "above" the rule now matches the traffic exceeding the rate.
Diffstat (limited to 'python')
-rw-r--r--python/vyos/wanloadbalance.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/python/vyos/wanloadbalance.py b/python/vyos/wanloadbalance.py
index fc9fb1ade..a8cd87350 100644
--- a/python/vyos/wanloadbalance.py
+++ b/python/vyos/wanloadbalance.py
@@ -117,7 +117,9 @@ def nft_rule(rule_conf, rule_id, local=False, exclude=False, limit=False, weight
output.append('ct state new')
if limit and 'limit' in rule_conf and 'rate' in rule_conf['limit']:
- output.append(f'limit rate {rule_conf["limit"]["rate"]}/{rule_conf["limit"]["period"]}')
+ # "above" matches the traffic exceeding the rate, "below" the rest
+ over = 'over ' if rule_conf['limit'].get('threshold') == 'above' else ''
+ output.append(f'limit rate {over}{rule_conf["limit"]["rate"]}/{rule_conf["limit"]["period"]}')
if 'burst' in rule_conf['limit']:
output.append(f'burst {rule_conf["limit"]["burst"]} packets')