diff --git a/ntpd/src/daemon/server.rs b/ntpd/src/daemon/server.rs index bcbcdca0b..59d1b3179 100644 --- a/ntpd/src/daemon/server.rs +++ b/ntpd/src/daemon/server.rs @@ -330,7 +330,6 @@ impl ServerTask { } Ok((length, peer_addr, opt_timestamp)) => { // FIXME: maybe perform min length and '%4' checks here to reduce work for those packets? - let request_buf = &buf[..length]; let mut response_buf = [0; MAX_PACKET_SIZE]; let response_buf = response_buf.as_mut_slice(); @@ -379,7 +378,7 @@ impl ServerTask { return None; } - let accept_result = self.accept_packet(request_buf, peer_addr, timestamp, filter_result); + let accept_result = self.accept_packet(request_buf, timestamp, filter_result); self.stats.update_from(&accept_result); @@ -506,12 +505,11 @@ impl ServerTask { fn accept_packet<'a>( &self, buf: &'a [u8], - peer_addr: SocketAddr, recv_timestamp: NtpTimestamp, filter_result: Result<(), FilterReason>, ) -> AcceptResult<'a> { // actually parse the packet - let accept_data = self.accept_data(buf, peer_addr, recv_timestamp); + let accept_data = self.accept_data(buf, recv_timestamp); match filter_result { Ok(_) => accept_data, @@ -525,17 +523,12 @@ impl ServerTask { /// - check if the packet can even be deserialized /// - check if it was successfully decrypted (and authenticated) /// - check if it was a request packet (`Client` prior to NTPv5) - fn accept_data<'a>( - &self, - buf: &'a [u8], - peer_addr: SocketAddr, - recv_timestamp: NtpTimestamp, - ) -> AcceptResult<'a> { + fn accept_data<'a>(&self, buf: &'a [u8], recv_timestamp: NtpTimestamp) -> AcceptResult<'a> { let keyset = self.keyset.borrow().clone(); match NtpPacket::deserialize(buf, keyset.as_ref()) { Ok((packet, decoded_cookie)) => match packet.mode() { NtpAssociationMode::Client => { - trace!("NTP client request accepted from {}", peer_addr); // TODO: move peer_addr to a tracing::span + trace!("NTP client request accepted"); AcceptResult::Accept { packet, decoded_cookie, @@ -543,11 +536,7 @@ impl ServerTask { } } _ => { - trace!( - "NTP packet with unknown mode {:?} ignored from {}", - packet.mode(), - peer_addr - ); + trace!("NTP packet with unknown mode {:?} ignored", packet.mode()); AcceptResult::Ignore } },