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).
This commit is contained in:
Red Bear OS
2026-07-08 18:39:28 +03:00
parent 82d8a049cc
commit 22d05e5f89
+4
View File
@@ -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