Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle underflow for PMTUD probe size and clip fixes for PMTUD tests #1744

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 9 additions & 6 deletions quiche/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3757,9 +3757,12 @@ impl Connection {
},
}

let frame = frame::Frame::Padding {
len: active_path.pmtud.get_probe_size() - overhead - 1,
};
let pmtud_padding: usize = active_path
.pmtud
.get_probe_size()
.saturating_sub(overhead + 1);

let frame = frame::Frame::Padding { len: pmtud_padding };

if push_frame_to_pkt!(b, frames, frame, left) {
let frame = frame::Frame::Ping {
Expand Down Expand Up @@ -16910,13 +16913,13 @@ mod tests {

// Check that PMTU params are configured correctly
let pmtu_param = &mut pipe.server.paths.get_mut(pid_1).unwrap().pmtud;
assert_eq!(pmtu_param.get_probe_status(), true);
assert!(pmtu_param.get_probe_status());
assert_eq!(pmtu_param.get_probe_size(), 1350);
assert_eq!(pipe.advance(), Ok(()));

for (_, p) in pipe.server.paths.iter_mut() {
assert_eq!(p.pmtud.get_current(), 1350);
assert_eq!(p.pmtud.get_probe_status(), false);
assert!(!p.pmtud.get_probe_status());
}
}

Expand Down Expand Up @@ -16970,7 +16973,7 @@ mod tests {
assert_eq!(pmtu_param.get_current(), 1200);

// Continue searching for PMTU
assert_eq!(pmtu_param.get_probe_status(), true);
assert!(pmtu_param.get_probe_status());
}
}

Expand Down