mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-12-01 14:18:36 +00:00
Fix unbounded ICMP sockets in direct outbound
The direct outbound opens one ICMP socket for each echo flow. The sockets were kept for one minute after the last packet and their number was not limited, so scanning hosts through the outbound could accumulate an unbounded number of sockets, which has been reported to panic the kernel on macOS. Close idle flows after ICMPTimeout as the stacks do, and keep at most 1024 flows, closing a least recently active one when the limit is reached.
This commit is contained in:
@@ -5,6 +5,8 @@ import (
|
||||
F "github.com/sagernet/sing/common/format"
|
||||
)
|
||||
|
||||
const ICMPFlowMax = 1024
|
||||
|
||||
type InterfaceType uint8
|
||||
|
||||
const (
|
||||
|
||||
Reference in New Issue
Block a user