fix(shaper): keep dry-run updates independent of CAKE rediscovery
Build / build (pull_request) Failing after 5s
DevSkim / DevSkim (pull_request) Failing after 1m21s
rust-clippy analyze / Run rust-clippy analyzing (pull_request) Failing after 1m37s

This commit is contained in:
Nils Andreas Svee committed 2026-09-24 23:40:58 +07:00
1 parent c3931064e7
commit c445d83952
1 file changed
+5 -1
+5 -1
View File
@@ -191,10 +191,14 @@ impl TrafficControlBackend for Netlink {
bandwidth_kbit: u64, bandwidth_kbit: u64,
dry_run: bool, dry_run: bool,
) -> Result<(), Self::Error> { ) -> Result<(), Self::Error> {
if dry_run {
return Self::set_qdisc_rate(shaper, bandwidth_kbit, true);
}
let mut last_warning = None; let mut last_warning = None;
loop { loop {
let result = Self::qdisc_from_ifname(&shaper.ifname) let result = Self::qdisc_from_ifname(&shaper.ifname)
.and_then(|current| Self::set_qdisc_rate(&current, bandwidth_kbit, dry_run)); .and_then(|current| Self::set_qdisc_rate(&current, bandwidth_kbit, false));
match result { match result {
Ok(()) => return Ok(()), Ok(()) => return Ok(()),
Err(error) if error.is_qdisc_loss() && !SHUTDOWN.load(Ordering::Relaxed) => { Err(error) if error.is_qdisc_loss() && !SHUTDOWN.load(Ordering::Relaxed) => {