世界 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
2025-09-22 12:51:12 +08:00
2025-09-22 12:51:12 +08:00
2025-09-22 12:51:12 +08:00
2026-03-02 06:50:15 +08:00
2026-03-02 06:50:15 +08:00
2022-07-11 17:15:22 +08:00
2025-08-23 16:16:28 +08:00
2025-03-19 20:37:02 +08:00
2025-03-19 20:37:02 +08:00
2025-03-19 20:37:02 +08:00
2023-08-12 19:38:06 +08:00
2025-03-19 20:37:02 +08:00
2023-04-17 20:02:10 +08:00
2024-06-07 15:48:43 +08:00
2025-06-20 12:47:57 +08:00
2023-08-12 19:38:06 +08:00
2025-08-24 10:36:16 +08:00
2025-09-12 18:02:59 +08:00
2024-10-14 22:10:23 +08:00
2025-08-22 10:56:12 +08:00
2025-07-21 09:44:17 +08:00
2025-07-18 11:00:19 +08:00
2022-09-08 18:11:26 +08:00
2023-12-21 16:51:06 +08:00
2025-09-22 12:51:12 +08:00
2025-02-17 21:56:54 +08:00
2026-01-29 13:34:49 +08:00

sing-tun

Simple transparent proxy library.

For Linux, Windows, macOS and iOS.

License

Copyright (C) 2022 by nekohasekai <contact-sagernet@sekai.icu>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Description
No description provided
Readme 1.9 MiB
Languages
Go 97.9%
Assembly 2%
Makefile 0.1%