Commit graph

17 commits

Author SHA1 Message Date
世界
caaf8469e0
Fix auto_redirect dropping SO_BINDTODEVICE traffic
REDIRECT in the OUTPUT chain rewrites the destination to 127.0.0.1,
then ip_route_me_harder() reroutes with the socket's bound interface
constraint (flowi4_oif). Since 127.0.0.1 is only reachable via lo,
the routing lookup fails and the packet is silently dropped.

Add a fallback routing table with `local 127.0.0.1` entries for each
non-loopback interface. When the local table lookup fails due to OIF
mismatch, the fallback table provides a matching RTN_LOCAL route.
The kernel then overrides dev_out to loopback (route.c:2857), so the
packet is delivered locally to the redirect server as intended.

This fixes NetworkManager connectivity checks and other tools that
use SO_BINDTODEVICE (e.g. curl --interface).
2026-03-11 21:15:11 +08:00
世界
5715a3919a
Fix nftablesCreateLocalAddressSets 2026-02-23 17:52:46 +08:00
世界
381bf9d40d
Skip tun interface traffic in prerouting UDP/ICMP chain 2026-01-28 18:27:44 +08:00
世界
a850c4f8a1
Add pre-matching support for auto redirect 2025-12-26 14:44:55 +08:00
世界
b5f3fecc25
ping: Fix linux route rules 2025-08-26 14:30:21 +08:00
世界
07e21b9170
Fix redirect panic 2025-08-01 16:46:29 +08:00
世界
5e343c4b66
Add loopback address support 2025-06-20 13:14:58 +08:00
世界
51ac6b34f1
redirect: Fix handling of local pings 2025-04-12 12:07:56 +08:00
世界
219c612399
redirect: Fix UDP rules 2025-04-09 11:01:57 +08:00
世界
a8ce3838bc
redirect: Only hijack DNS requests from local addresses 2025-04-02 15:47:17 +08:00
世界
d093b82064
auto-redirect: Fetch interfaces 2025-01-07 19:01:54 +08:00
世界
059f5b6aaf
auto-redirect: Let fw4 take precedence over prerouting 2024-10-13 13:26:08 +08:00
世界
1048b277ea
Skip generate nftables output chain if lo in excluded interface list 2024-06-17 13:29:56 +08:00
世界
85f5f2dd58
auto-redirect: Add route address set support for nftables 2024-06-16 15:37:27 +08:00
世界
85fe25a592
Improve nftables rules 2024-06-11 21:12:08 +08:00
世界
65383d3c39
Make DNS hijack optional 2024-06-07 15:49:16 +08:00
世界
67a5b408ef
Add auto-redirect 2024-06-07 15:48:43 +08:00