From 22d05e5f890e7955f7f084b79bb334a1c4c1f09f Mon Sep 17 00:00:00 2001 From: Red Bear OS Date: Wed, 8 Jul 2026 18:39:28 +0300 Subject: [PATCH] stats: actually track rx_dropped on neighbor-resolution failures The new rx_dropped counter is now incremented in real drop paths: - drop_waiting_packets_v4: ARP/NDP failed after MAX_TRIES, packets dropped - drop_waiting_packets_v6: same for IPv6 neighbor discovery - handle_missing_neighbor: waiting queue full, incoming packet dropped Net effect: stats now reflect actual packet loss conditions visible via /scheme/netcfg/ifaces/eth0/stats: rx_dropped=N (was always 0 before) tx_dropped was already incremented by qdisc drops (R24). --- netstack/src/link/ethernet.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/netstack/src/link/ethernet.rs b/netstack/src/link/ethernet.rs index 3c4efd8d9a..c10f504552 100644 --- a/netstack/src/link/ethernet.rs +++ b/netstack/src/link/ethernet.rs @@ -304,6 +304,7 @@ impl EthernetLink { } let _ = self.waiting_packets.dequeue(); + self.stats.rx_dropped += 1; debug!( "Dropped packet on {} because neighbor was not found", self.name @@ -363,6 +364,7 @@ impl EthernetLink { } Ok((IpAddress::Ipv4(_), _)) => { let _ = self.waiting_packets.dequeue(); + self.stats.rx_dropped += 1; continue; } Err(_) => { @@ -372,12 +374,14 @@ impl EthernetLink { } let _ = self.waiting_packets.dequeue(); + self.stats.rx_dropped += 1; debug!("Dropped packet on {} because IPv6 neighbor was not found", self.name); } } fn handle_missing_neighbor(&mut self, next_hop: IpAddress, packet: &[u8], now: Instant) { let Ok(buf) = self.waiting_packets.enqueue(packet.len(), next_hop) else { + self.stats.rx_dropped += 1; warn!( "Dropped packet on {} because waiting queue was full", self.name