Skip to content

Commit

Permalink
Revert "fix(s2n-quic-transport): Unmap peer address when determining …
Browse files Browse the repository at this point in the history
…MTU probe size (#1321)"

This reverts commit 88aa6a2.
  • Loading branch information
camshaft committed Jun 3, 2022
1 parent b9a6c7d commit 6b7eeb2
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions quic/s2n-quic-transport/src/path/mtu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ impl Controller {
/// The UDP header length and IP header length will be subtracted from `max_mtu` to
/// determine the max_udp_payload used for limiting the payload length of probe packets.
pub fn new(max_mtu: MaxMtu, peer_socket_address: &SocketAddress) -> Self {
let min_ip_header_len = match peer_socket_address.unmap() {
let min_ip_header_len = match peer_socket_address {
SocketAddress::IpV4(_) => IPV4_MIN_HEADER_LEN,
SocketAddress::IpV6(_) => IPV6_MIN_HEADER_LEN,
};
Expand Down Expand Up @@ -524,26 +524,6 @@ mod test {
);
}

#[test]
fn new_ipv6_mapped() {
let addr: SocketAddr = "127.0.0.1:443".parse().unwrap();
let addr: SocketAddress = addr.into();
let controller = Controller::new(1600.try_into().unwrap(), &addr.to_ipv6_mapped().into());

assert_eq!(
1600 - UDP_HEADER_LEN - IPV4_MIN_HEADER_LEN,
controller.max_udp_payload
);
assert_eq!(
1600 - UDP_HEADER_LEN - IPV4_MIN_HEADER_LEN,
controller.max_probe_size
);
assert_eq!(
ETHERNET_MTU - UDP_HEADER_LEN - IPV4_MIN_HEADER_LEN,
controller.probed_size
);
}

#[test]
fn enable_already_enabled() {
let mut controller = new_controller(1500);
Expand Down

0 comments on commit 6b7eeb2

Please sign in to comment.