Skip to content

Commit

Permalink
Log
Browse files Browse the repository at this point in the history
  • Loading branch information
larseggert committed Sep 30, 2024
1 parent 5f2e4b5 commit 5f03837
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion neqo-transport/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ indexmap = { version = "2.2", default-features = false } # See https://github.co
log = { workspace = true }
neqo-common = { path = "../neqo-common" }
neqo-crypto = { path = "../neqo-crypto" }
mtu = { version = "0.1.3", default-features = false }
mtu = { path = "../../mtu", default-features = false }
qlog = { workspace = true }
smallvec = { version = "1.11", default-features = false }
static_assertions = { version = "1.1", default-features = false }
Expand Down
19 changes: 16 additions & 3 deletions neqo-transport/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ use std::{
time::{Duration, Instant},
};

use neqo_common::{hex, qdebug, qinfo, qlog::NeqoQlog, qtrace, Datagram, Encoder, IpTos, IpTosEcn};
use neqo_common::{
hex, qdebug, qinfo, qlog::NeqoQlog, qtrace, qwarn, Datagram, Encoder, IpTos, IpTosEcn,
};
use neqo_crypto::random;

use crate::{
Expand Down Expand Up @@ -569,8 +571,19 @@ impl Path {
qlog: NeqoQlog,
now: Instant,
) -> Self {
let iface_mtu =
mtu::interface_and_mtu(&(local, remote)).map_or_else(|_| usize::MAX, |(_, m)| m);
// We're passing `None` into `mtu::interface_and_mtu` here, which force the lookup to only
// take the local address into account. Taking the remote address into account would require
// a call to `connect`, which Firefox blocklists for Rust dependencies.
let iface_mtu = match mtu::interface_and_mtu(&(local.ip(), remote)) {
Ok((name, mtu)) => {
qdebug!("Outbound interface {name} has MTU {mtu}");
mtu
}
Err(e) => {
qwarn!("Failed to determine outbound interface: {e}");
usize::MAX
}
};
let mut sender = PacketSender::new(cc, pacing, Pmtud::new(remote.ip(), iface_mtu), now);
sender.set_qlog(qlog.clone());
Self {
Expand Down

0 comments on commit 5f03837

Please sign in to comment.