summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorRoman Khramshin <HollyGurza@users.noreply.github.com>2024-11-08 14:50:14 +0600
committerGitHub <noreply@github.com>2024-11-08 10:50:14 +0200
commit4139e1c12c3f8d6abdf42dc3febfffc097a41c7a (patch)
treee721dbcd7209926fd7fca8befa6377839f64f8ad /python
parent5fac74ef9d3356a66a39e8ea6ddcb40d6944e23b (diff)
downloadvyos-1x-4139e1c12c3f8d6abdf42dc3febfffc097a41c7a.tar.gz
vyos-1x-4139e1c12c3f8d6abdf42dc3febfffc097a41c7a.zip
T6802: Fix QoS Policy Round-Robin with Default Configuration (#4177)
- Resolved unhandled exception occurring with default round-robin policy config. - Added default filter to ensure proper round-robin policy.
Diffstat (limited to 'python')
-rw-r--r--python/vyos/qos/roundrobin.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/python/vyos/qos/roundrobin.py b/python/vyos/qos/roundrobin.py
index 80814ddfb..509c4069f 100644
--- a/python/vyos/qos/roundrobin.py
+++ b/python/vyos/qos/roundrobin.py
@@ -15,6 +15,7 @@
from vyos.qos.base import QoSBase
+
class RoundRobin(QoSBase):
_parent = 1
@@ -34,11 +35,21 @@ class RoundRobin(QoSBase):
if 'default' in config:
class_id_max = self._get_class_max_id(config)
- default_cls_id = int(class_id_max) +1
+ default_cls_id = int(class_id_max) + 1 if class_id_max else 1
# class ID via CLI is in range 1-4095, thus 1000 hex = 4096
tmp = f'tc class replace dev {self._interface} parent 1:1 classid 1:{default_cls_id:x} drr'
self._cmd(tmp)
+ # You need to add at least one filter to classify packets
+ # otherwise, all packets will be dropped.
+ filter_cmd = (
+ f'tc filter replace dev {self._interface} '
+ f'parent {self._parent:x}: prio {default_cls_id} protocol all '
+ 'u32 match u32 0 0 '
+ f'flowid {self._parent}:{default_cls_id}'
+ )
+ self._cmd(filter_cmd)
+
# call base class
super().update(config, direction, priority=True)