Commit graph

50 commits

Author SHA1 Message Date
Leadaxe
d31d20ba58 system stack: self-heal the TCP forwarder accept loop (sing-box-lx SPEC 040)
Upstream acceptLoop treats any Accept error as terminal and silently
returns, leaving the stack alive but every new TCP SYN NAT-rewritten onto
a dead port (instant RST) until a full restart. When the listener fd is
closed out from under the stack (a stray close on a reused fd number from
another runtime in the same process), all new TCP dies forever while
UDP/QUIC/DNS keep working.

- System.Close() now marks a deliberate shutdown first; acceptLoop still
  exits quietly on it.
- Any other Accept error is logged (the errno names the killer path),
  the listener is recreated on the same address, the forwarder port is
  republished atomically, and the loop keeps serving.
- If the rebind fails, the loop logs an error and gives up - no worse
  than upstream.
- acceptRecoveries counter is kept as telemetry.

tcpPort/tcpPort6 become atomic (written by the heal path, read from the
tunLoop dispatch/NAT path); listener replacement is serialized against
Close() with a mutex.
2026-08-05 16:57:11 +03:00
世界
b59636919c
Add Stack.ResetNetwork 2026-07-27 23:11:49 +08:00
世界
95bc107a1c
refactor: New udpnat 2026-07-27 23:11:49 +08:00
世界
994d6ccdbf
Add netns support 2026-07-27 23:11:48 +08:00
世界
b0188bc3f1
Improve darwin forwarding 2026-07-27 23:11:48 +08:00
世界
c17af6ee8c
Minor fixes 2026-07-27 23:11:48 +08:00
世界
ed63adda33
Add flow dispatcher 2026-07-27 23:11:48 +08:00
世界
a9027729be
Make gtcpip public for external use 2026-07-27 23:11:48 +08:00
世界
c569e3e92f
Fix gVisor process 2026-07-27 10:25:59 +08:00
世界
46aa536b37
Fix lint errors 2026-07-27 10:23:30 +08:00
世界
bebc8d67f3
stack: Add icmp timeout 2026-06-01 17:48:51 +08:00
世界
1010e39d79
Fix IPv6 UDP packet leak in system stack 2026-05-19 17:00:09 +08:00
世界
31c44bc478
Fix buffer not released in batchLoopDarwin 2026-04-10 14:12:21 +08:00
世界
24b12270db
Fix system stack rewriting TUN subnet destinations to loopback
The acceptLoop was rewriting any TCP destination within the TUN
address prefix to 127.0.0.1/::1. This incorrectly caught the
gateway address and other subnet addresses, not just the interface
address itself.
2026-03-23 19:37:57 +08:00
世界
c81ce6d358
Fix darwin batch loop not exit on EBADF 2026-03-05 20:35:38 +08:00
世界
b76e852f59
ping: Fix reject 2025-08-27 20:29:08 +08:00
世界
adc106bcf6
Improve checksum usages 2025-08-27 11:07:26 +08:00
世界
4c43f4af12
ping: Fix not handling reject 2025-08-27 00:30:40 +08:00
世界
e6c64e3f18
Update icmp network name 2025-08-25 22:43:59 +08:00
世界
ff4941daa4
Pass timeout to PrepareConnection 2025-08-24 18:59:55 +08:00
世界
86d96064d5
ping: Add gVisor destination 2025-08-24 10:36:16 +08:00
世界
a256dca36b
Fix ping response for tun address 2025-08-23 16:43:33 +08:00
世界
8dbb51cfb7
Add ping client 2025-08-23 16:16:28 +08:00
世界
933bd2b2d5
Add ping proxy support 2025-08-22 10:56:12 +08:00
世界
ebbe32588c
Fix system stack 2025-07-21 09:44:17 +08:00
世界
aa1fd4d994
Improve darwin tun performance 2025-07-17 23:46:08 +08:00
世界
7812930a48
Minor fixes 2025-07-13 15:58:13 +08:00
世界
a0881ada32
Improve darwin tun performance 2025-07-03 20:17:32 +08:00
世界
5e343c4b66
Add loopback address support 2025-06-20 13:14:58 +08:00
世界
2121bc3f01
Fix error usages 2025-06-20 12:47:57 +08:00
dyhkwong
c410f7050c
Add firewall rule for Profile ALL on Windows system stack 2025-04-11 10:41:51 +08:00
bemarkt
c8c2984261
Fix wrong parameter in ICMPv4Checksum 2025-02-10 14:20:22 +08:00
世界
2b8115e83b
Copy UDP GSO support from tailscale 2024-11-23 12:58:52 +08:00
世界
4ebeb2fa86
Export interface for WireGuard 2024-11-23 12:58:52 +08:00
世界
1015c096bb
Fix gvisor UDP nat 2024-11-09 11:44:42 +08:00
世界
a5cb9f4f5f
Remove unused ICMP replies & Improve tcpbuf options 2024-11-08 12:15:52 +08:00
世界
9bcc1ec384
Minor fixes 2024-11-08 12:15:39 +08:00
世界
e95737eccb
Implement TCP and ICMP rejects 2024-11-08 12:15:38 +08:00
世界
1793988a6d
Migrate clashtcpip to gVisor tcpip copied 2024-11-08 12:15:37 +08:00
世界
7f8e556bb0
Migrate to udpnat2 / Add PrepareConnection 2024-11-08 12:15:37 +08:00
世界
99eea00432
Update network handler usages 2024-11-08 12:15:37 +08:00
世界
10f73346a0
Fix gateway & FIx prefix check 2024-10-31 21:58:09 +08:00
世界
07278fb470
Retry system listen 2024-10-14 22:10:23 +08:00
世界
fb6e917a2c
Add StackOptions.IncludeAllNetworks 2024-05-07 20:20:44 +08:00
世界
ebb3908ecf
Fix bind forwarder to interface for systems stack 2023-12-21 16:51:25 +08:00
世界
5b50c61b72
Add GSO support 2023-12-21 16:51:06 +08:00
世界
ce9c864d89
system: Check UDP invalid packet 2023-11-14 17:16:24 +08:00
世界
da350ecc72
Add broadcast filter 2023-11-06 21:33:35 +08:00
世界
150b116231
Add multicast filter 2023-11-04 08:01:41 +08:00
世界
aa8760b454
Add handshake interface support for gVisor UDP 2023-08-07 20:32:32 +08:00
Renamed from system.go (Browse further)