Commit Graph

172 Commits

Author SHA1 Message Date
世界
1362e5d4fc Fix minor robustness issues found during code review
- dns/router: add r.closing guard in registerRuleSetCallbacks to
  prevent callback leak when Close() races with Start() in daemon path
- adapter/inbound: validate addr.IsValid() in DNSResponseAddresses
  before appending to guard against zero-RDATA DNS records
- adapter/rule: add evaluate to non-final actions in IsFinalAction
2026-04-07 00:54:51 +08:00
世界
9e95438463 Format code 2026-04-07 00:54:50 +08:00
世界
73c7d7ec82 adapter: remove unused DestinationAddressesForMatch 2026-04-07 00:54:48 +08:00
世界
ab99607614 route/rule: remove dead IgnoreDestinationIPCIDRMatch field
The field was never set to true after the legacy pre-match refactor
in 3549c02b8. Remove the declaration, guard check, and redundant
false assignments.
2026-04-07 00:54:44 +08:00
世界
f5b58215fc Use typed SVCB hint structs instead of string parsing 2026-04-07 00:54:42 +08:00
世界
7257fa590e Fix legacy DNS rule_set accept_empty matching 2026-04-07 00:54:42 +08:00
世界
60c9f02fb4 dns: make rule path selection rule-set aware 2026-04-07 00:54:41 +08:00
世界
a5c3201140 dns: isolate legacy pre-match semantics 2026-04-07 00:54:40 +08:00
世界
0893488073 dns: preserve legacy address-filter pre-match semantics
Legacy DNS address-filter mode still accepts destination-side IP
predicates with a deprecation warning, but the recent evaluate/
match_response refactor started evaluating those predicates during
pre-response Match(). That broke rules whose transport selection must
be deferred until MatchAddressLimit() can inspect the upstream reply.

Restore the old defer behavior by reintroducing an internal
IgnoreDestinationIPCIDRMatch flag on InboundContext and using it only
for legacy pre-response DNS matching. Default and logical DNS rules now
carry the legacy mode bit, set the ignore flag on metadata copies while
performing pre-response Match(), and explicitly clear it again for
match_response and MatchAddressLimit() so response-phase matching still
checks the returned addresses.

Add regression coverage for direct legacy destination-IP rules,
rule_set-backed CIDR rules, logical wrappers, and the legacy Lookup
router path, including fallback after a rejected response. This keeps
legacy configs working without changing new-mode evaluate semantics.

Tests: go test ./route/rule ./dns
Tests: make
2026-04-07 00:54:40 +08:00
世界
01079a2483 Remove legacy DNS server formats 2026-04-07 00:54:40 +08:00
世界
de73486d21 Fix DNS pre-match CIDR fail-closed semantics 2026-04-07 00:54:40 +08:00
世界
097e75cc02 dns: use response-only address matching 2026-04-07 00:54:40 +08:00
世界
ae65281254 Fix DNS match_response response address handling 2026-04-07 00:54:39 +08:00
世界
2d08d34e0b Add evaluate DNS rule action and related rule items 2026-04-07 00:54:39 +08:00
nekohasekai
d98ab6f1b8 Refactor ACME support to certificate provider 2026-04-06 23:36:05 +08:00
世界
594932a226 Add Android support for MAC and hostname rule items 2026-04-06 23:36:05 +08:00
世界
793ad6ffc5 Add MAC and hostname rule items 2026-04-06 23:36:05 +08:00
世界
0045103d14 Fix package_name shared uid matching 2026-03-23 18:57:35 +08:00
世界
795d1c2892 Fix nested rule-set match cache isolation 2026-03-23 12:26:19 +08:00
世界
8ae93a98e5 Remove overdue deprecated features 2026-03-01 12:30:43 +08:00
世界
cf4791f1ad platform: Improve iOS OOM killer 2026-02-26 14:13:32 +08:00
世界
1af14a0237 Remove varbin usages 2026-01-29 13:40:34 +08:00
世界
0caebd3171 platform: Improve interface 2026-01-17 05:49:12 +08:00
世界
aa8dd6e44f Fix DNS transports 2026-01-17 05:48:41 +08:00
世界
494990f914 Update bypass action behavior for auto redirect 2026-01-17 05:48:41 +08:00
世界
faff3174a3 Add trace logging for lifecycle calls
Log start/close operations with timing information for debugging.
2026-01-17 05:47:54 +08:00
世界
ac427b98f4 platform: Add UsePlatformWIFIMonitor to gRPC interface
Align dev-next-grpc with wip2 by adding UsePlatformWIFIMonitor()
to the new PlatformInterface, allowing platform clients to indicate
they handle WIFI monitoring themselves.
2026-01-17 05:47:32 +08:00
世界
5bc0dfa9dd platform: Refactoring libbox to use gRPC-based protocol 2026-01-17 05:47:32 +08:00
世界
8d8ca282a1 Add Linux WI-FI state support
Support monitoring WIFI state on Linux through:
- NetworkManager (D-Bus)
- IWD (D-Bus)
- wpa_supplicant (control socket)
- ConnMan (D-Bus)
2026-01-17 05:47:04 +08:00
世界
f84129ca79 Add proxy support for ICMP echo request 2026-01-17 05:44:41 +08:00
世界
239e6ec701 Add preferred_by route rule item 2026-01-17 05:44:27 +08:00
世界
1ebff74c21 Fix DNS cache not working when domain strategy is set
The cache lookup was performed before rule matching, using the caller's
strategy (usually AsIS/0) instead of the resolved strategy. This caused
cache misses when ipv4_only was configured globally but the cache lookup
expected both A and AAAA records.

Remove LookupCache and ExchangeCache from Router, as the cache checks
inside client.Lookup and client.Exchange already handle caching correctly
after rule matching with the proper strategy and transport.
2025-12-21 16:59:10 +08:00
世界
216c4c8bd4 Fix adapter handler 2025-11-16 08:34:46 +08:00
世界
f352f84483 Fix read address 2025-09-05 15:16:14 +08:00
世界
cbf48e9b8c Fix multiple sniff 2025-09-03 20:09:05 +08:00
世界
22782ca6fc Fix outbound start 2025-08-21 09:41:31 +08:00
世界
acda4ce985 Fix bind_interface not working with auto_redirect 2025-08-17 14:48:01 +08:00
世界
354ece2bdf Fix resolved service 2025-08-16 00:09:29 +08:00
世界
378e39f70c Update golangci-lint to v2 2025-08-13 23:37:40 +08:00
世界
0146fbfc40 Add SSM API service 2025-07-08 13:14:42 +08:00
世界
6ee3117755 Add resolved service and DNS server 2025-07-08 13:14:41 +08:00
世界
7a1eee78df Add service component type 2025-07-08 13:14:41 +08:00
世界
3b480de38a Add TLS record fragment support 2025-07-08 13:14:38 +08:00
世界
fb622ccbdf Explicitly reject detour to empty direct outbounds 2025-07-08 13:12:28 +08:00
Alireza Ahmadi
b4a8fa59f5 Fix Outbound deadlock 2025-07-08 13:12:19 +08:00
世界
17576e9f66 Add certificate store 2025-07-08 13:12:14 +08:00
世界
90ec9c8bcb Add TLS fragment support 2025-07-08 13:12:14 +08:00
世界
988ac62a1b refactor: Outbound domain resolver 2025-07-08 13:12:14 +08:00
世界
3016338e34 refactor: DNS 2025-07-08 13:12:14 +08:00
世界
7d3ee29bd0 Also skip duplicate sniff for TCP 2025-06-21 12:57:27 +08:00