* Restore the silently dropped embedded TUN routing rules
tun_singbox_rules declares "network": "udp" as a bare string, but
Rule4Sbox.network is a List<string>. System.Text.Json therefore throws on
the very first rule, and JsonUtils.Deserialize swallows it and returns
default. GenRouting only checks for null before AddRange, so the whole
embedded rule set is dropped without a trace.
Both rules it carries have thus never reached a generated config: the
NetBIOS/mDNS reject and the multicast reject. The mismatch predates the
sing-box 1.12 migration - the template has used the string form since the
rules file was introduced.
- declare network as an array so the template matches Rule4Sbox
* Drop traffic addressed to the TUN's own addresses
With auto_route the TUN steals the default route, so a packet whose
destination is the TUN interface's own address is handed to sing-box instead
of being looped back by the kernel. Routing then matches ip_is_private and
sends it to `direct`, whose interface is auto-detected as the TUN again, so
the packet is written straight back into the TUN and re-enters routing. The
loop never terminates and pins a CPU core.
Seen in the wild on macOS: a WebRTC client offered the TUN's own
fc00::172:18:0:1 ULA as an ICE candidate and the resulting STUN
connectivity checks sustained ~8k packets/s out of the interface at 800%
CPU, 21 GB written to the TUN over five hours - against 3 GB read, the
asymmetry that gives the loop away.
Nothing legitimate is addressed to those addresses, so reject them before
any outbound rule can match. Use method "drop" rather than the default
ICMP unreachable, whose destination would be the looping address itself.
- reject the TUN inbound's own addresses, taken from the generated inbound
so the two cannot drift apart
Introduces EchConfigList and EchForceQuery fields to ProfileItem and V2rayConfig models, updates related handlers and services to process these fields, and extends the AddServerWindow UI to allow user input for ECH configuration. Also adds localization entries for the new fields and updates extension methods for string handling.
* Multi Profile
* VM and wpf
* avalonia
* Fix right click not working
* Exclude specific profile types from selection
* Rename
* Add Policy Group support
* Add generate policy group
* Adjust UI
* Add Proxy Chain support
* Fix
* Add fallback support
* Add PolicyGroup include other Group support
* Add group in traffic splitting support
* Avoid duplicate tags
* Refactor
* Adjust chained proxy, actual outbound is at the top
Based on actual network flow instead of data packets
* Add helper function
* Refactor
* Add chain selection control to group outbounds
* Avoid self-reference
* Fix
* Improves Tun2Socks address handling
* Avoids circular dependency in profile groups
Adds cycle detection to prevent infinite loops when evaluating profile groups.
This ensures that profile group configurations don't result in stack overflow errors when groups reference each other, directly or indirectly.
* Fix
* Fix
* Update ProfileGroupItem.cs
* Refactor
* Remove unnecessary checks
---------
Co-authored-by: 2dust <31833384+2dust@users.noreply.github.com>