shinobu/router/tc: Properly use hex for identifiers

This commit is contained in:
Simon Bruder 2023-10-18 20:01:34 +02:00
parent 5d696d67f0
commit 19da5e13b9
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC

View file

@ -18,8 +18,8 @@ let
, qdiscArgs ? [ "fq_codel" ]
, prio
}: ''
tc class add dev ${cfg.interface} parent ${toString cfg.major}:1 classid ${toString cfg.major}:${toString minor} htb rate ${rate} ceil ${ceil} burst ${burst} prio ${toString prio}
tc qdisc add dev ${cfg.interface} parent ${toString cfg.major}:${toString minor} handle ${toString minor}:1 ${lib.escapeShellArgs qdiscArgs}
tc class add dev ${cfg.interface} parent ${lib.toHexString cfg.major}:1 classid ${lib.toHexString cfg.major}:${lib.toHexString minor} htb rate ${rate} ceil ${ceil} burst ${burst} prio ${toString prio}
tc qdisc add dev ${cfg.interface} parent ${lib.toHexString cfg.major}:${lib.toHexString minor} handle ${lib.toHexString minor}:1 ${lib.escapeShellArgs qdiscArgs}
'';
in
{
@ -36,8 +36,8 @@ in
# deleting might fail
tc qdisc del root dev ${cfg.interface} || true
tc qdisc add dev ${cfg.interface} root handle ${toString cfg.major}:0 htb default 2
tc class add dev ${cfg.interface} parent ${toString cfg.major}:0 classid ${toString cfg.major}:1 htb rate ${toString cfg.rate} burst 15k
tc qdisc add dev ${cfg.interface} root handle ${lib.toHexString cfg.major}:0 htb default 2
tc class add dev ${cfg.interface} parent ${lib.toHexString cfg.major}:0 classid ${lib.toHexString cfg.major}:1 htb rate ${toString cfg.rate} burst 15k
${lib.concatMapStrings mkClass cfg.classes}
'';