mirror of
https://github.com/openwrt/openwrt.git
synced 2026-10-26 01:29:33 +04:00
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>