diff --git a/src/codec/qcmp.rs b/src/codec/qcmp.rs index 175997d97..20e51b054 100644 --- a/src/codec/qcmp.rs +++ b/src/codec/qcmp.rs @@ -400,7 +400,7 @@ pub fn spawn(socket: socket2::Socket, mut shutdown_rx: crate::ShutdownRx) -> cra tracing::debug!("sending QCMP ping reply"); // Update the iovec with the actual length of the pong - iov.iov_len = buf.buf.len(); + iov.iov_len = buf.len; // Note we don't have to do anything else with the msghdr // as the recv has already filled in the socket address diff --git a/src/components/proxy/packet_router/reference.rs b/src/components/proxy/packet_router/reference.rs index b521e0530..438dc2207 100644 --- a/src/components/proxy/packet_router/reference.rs +++ b/src/components/proxy/packet_router/reference.rs @@ -1,7 +1,10 @@ //! The reference implementation is used for non-Linux targets impl super::DownstreamReceiveWorkerConfig { - pub async fn spawn(self) -> eyre::Result>> { + pub async fn spawn( + self, + _shutdown: crate::ShutdownRx, + ) -> eyre::Result>> { let Self { worker_id, upstream_receiver, @@ -38,12 +41,16 @@ impl super::DownstreamReceiveWorkerConfig { crate::metrics::errors_total( crate::metrics::WRITE, &error.to_string(), - None, + &crate::metrics::EMPTY, ) .inc(); } - Ok((data, asn_info, send_addr)) => { - let (result, _) = send_socket.send_to(data, send_addr).await; + Ok(crate::components::proxy::SendPacket { + destination, + asn_info, + data, + }) => { + let (result, _) = send_socket.send_to(data, destination).await; let asn_info = asn_info.as_ref(); match result { Ok(size) => { @@ -100,8 +107,11 @@ impl super::DownstreamReceiveWorkerConfig { }; if let Some(last_received_at) = last_received_at { - crate::metrics::packet_jitter(crate::metrics::READ, None) - .set((packet.received_at - last_received_at).nanos()); + crate::metrics::packet_jitter( + crate::metrics::READ, + &crate::metrics::EMPTY, + ) + .set((packet.received_at - last_received_at).nanos()); } last_received_at = Some(packet.received_at); diff --git a/src/components/proxy/sessions/reference.rs b/src/components/proxy/sessions/reference.rs index 1c332db3d..706eebeb9 100644 --- a/src/components/proxy/sessions/reference.rs +++ b/src/components/proxy/sessions/reference.rs @@ -25,7 +25,7 @@ impl super::SessionPool { crate::metrics::errors_total( crate::metrics::WRITE, "downstream channel closed", - None, + &crate::metrics::EMPTY, ) .inc(); break; @@ -35,7 +35,7 @@ impl super::SessionPool { data, asn_info, }) => { - tracing::trace!(%dest, length = data.len(), "sending packet upstream"); + tracing::trace!(%destination, length = data.len(), "sending packet upstream"); let (result, _) = socket2.send_to(data, destination).await; let asn_info = asn_info.as_ref(); match result { @@ -80,7 +80,7 @@ impl super::SessionPool { match result { Err(error) => { tracing::trace!(%error, "error receiving packet"); - crate::metrics::errors_total(crate::metrics::WRITE, &error.to_string(), None).inc(); + crate::metrics::errors_total(crate::metrics::WRITE, &error.to_string(), &crate::metrics::EMPTY).inc(); }, Ok((_size, recv_addr)) => pool.process_received_upstream_packet(buf, recv_addr, port, &mut last_received_at).await, }