Files
openwrt/target/linux
Gennaro Cimmino 1583716e42 realtek: l3: rtl839x: trap packets whose TTL runs out
What an RTL839x does with a routed IPv4 packet whose TTL runs out is
set by the IP4_TTL_EXECEED field of ROUTING_EXCPT_CTRL, and nothing in
the driver writes that register. On main, #25768 found that an echo
request with TTL 1 through an offloaded route got no Time Exceeded
from the switch, and nothing reached the gateway either.

Set the field to trap, so that the CPU gets the packet and the kernel
answers it as it would on a route it forwards itself. The encoding,
0 drop, 1 forward, 2 trap, is the one of the Realtek GPL SDK
(dal_cypress_trap.c). The other fields of the register keep their
value.

Tested on an HPE 1920-48G (RTL8393), with 10.99.1.0/24 offloaded
through a gateway behind the client's own port and 8 echo requests
with TTL 1 per case, in one boot. With the field at 2, the client got
7 Time Exceeded replies, consistent with the kernel's ICMP rate limit,
and none of the requests reached the gateway. With the field forced
to 0 through devmem, the client got no reply and nothing reached the
gateway, the symptom #25768 reported on main. Echo requests with the
default TTL still reached the gateway 8/8, TTL 63, with IPv4
forwarding off.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/25794
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-10-10 21:35:17 +02:00
..
2026-10-04 15:57:54 +02:00
2026-10-01 00:49:54 +02:00
2026-10-06 18:35:40 +01:00
2026-10-04 15:57:54 +02:00
2026-07-23 09:08:57 +02:00
2026-10-08 23:45:02 +02:00
2026-10-01 00:49:54 +02:00
2026-10-06 18:35:40 +01:00
2026-10-06 15:11:36 +02:00
2026-10-01 00:50:42 +02:00
2026-08-13 00:22:31 +02:00
2026-10-01 00:49:54 +02:00
2026-10-06 18:35:40 +01:00
2026-10-06 18:35:40 +01:00