From c5c195f282e998f0445b90ad231a37f2440f2fb2 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Fri, 18 Apr 2025 14:55:43 +1000 Subject: [PATCH] chore(eBPF): change error log-levels (#8805) Neither of the moved error cases should happen very often so it is fine to log them on debug. - `Error::NotTurn` only happens if we receive a UDP packet that isn't STUN traffic (port 3478) or not in the allocation-port range. I am suspecting there to be a bug that I am aiming to fix in #8804. - `Error::NotAChannelDataMessage` will happen for all STUN control traffic, like channel bindings, allocation requests, etc. Those only happen occasionally so won't spam too much. - `Ipv4PacketWithOptions` should basically not happen at all because - as far as I know - IPv4 options aren't used a lot. In any case, when debugging, it is useful to see when we do hit these cases to know, why a packet was offloaded to user space. --- rust/relay/ebpf-turn-router/src/main.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/rust/relay/ebpf-turn-router/src/main.rs b/rust/relay/ebpf-turn-router/src/main.rs index f47af7e11..a0c4946e8 100644 --- a/rust/relay/ebpf-turn-router/src/main.rs +++ b/rust/relay/ebpf-turn-router/src/main.rs @@ -69,13 +69,12 @@ static UDP_TO_CHAN_64: HashMap = #[xdp] pub fn handle_turn(ctx: XdpContext) -> u32 { try_handle_turn(&ctx).unwrap_or_else(|e| match e { - Error::NotUdp - | Error::NotTurn - | Error::NotIp - | Error::NotAChannelDataMessage - | Error::Ipv4PacketWithOptions => xdp_action::XDP_PASS, + Error::NotIp | Error::NotUdp => xdp_action::XDP_PASS, Error::PacketTooShort + | Error::NotTurn + | Error::NotAChannelDataMessage + | Error::Ipv4PacketWithOptions | Error::NoMacAddress | Error::UnsupportedChannel(_) | Error::NoEntry(_) => {