Commit Graph

2308 Commits

Author SHA1 Message Date
世界
ef99a87de7 dns: reject method reply is not supported for DNS rules
Add config-time validation in NewDNSRule that rejects
RejectMethodReply for both default and logical DNS rules,
matching the existing TCP/UDP validation in route/route.go.
2026-04-01 16:23:40 +08:00
世界
a83f2e977d dns: improve test coverage and cleanup
- Add t.Cleanup(router.Close) in newTestRouter for automatic cleanup
- Remove unnecessary testCase loop variable capture (Go 1.22+)
- Add tests for reject drop action, route_options effect, and
  chained evaluate response overwrite
2026-04-01 16:23:40 +08:00
世界
6a4b0db245 dns: fix test style issues in repro_test.go
- Rename addrs to addresses per naming conventions
- Replace errors.New with E.New per error-handling rules
2026-04-01 16:23:40 +08:00
世界
e6377f7ec9 fix: add missing EnvName, document Strategy invariant, improve rcode display
- Add EnvName to four new deprecation constants so users can suppress
  warnings via ENABLE_DEPRECATED_* environment variables
- Add comment explaining why applyDNSRouteOptions skips Strategy
- Use dns.RcodeToString in DNSResponseRCodeItem.String() for readability
- Remove redundant Fqdn(FqdnToDomain(domain)) round-trip
2026-04-01 16:23:40 +08:00
世界
1897e512ac docs: fix strategy deprecation format, explain legacyDNSMode, unify CN/EN order
- Use standard !!! failure block for strategy deprecation notice
- Add Legacy DNS Mode section explaining automatic mode detection
- Reorder ip_accept_any/rule_set_ip_cidr_accept_empty in Chinese docs
  to match English
2026-04-01 16:23:40 +08:00
世界
19b2e48f6e dns: populate reverse mapping for legacy predefined responses
The legacy path returned predefined responses early, bypassing the
reverse mapping cache. Use goto to reach the shared post-exchange
block so both legacy and new paths record predefined A/AAAA answers.
2026-04-01 16:23:39 +08:00
世界
be4e696632 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-01 16:23:39 +08:00
世界
866731344f dns: use refcounted snapshot to narrow rule lock scope
Exchange and Lookup held rulesAccess.RLock across all DNS network I/O,
blocking rebuildRules from swapping in new rules until every in-flight
query finished. Replace the RWMutex with an atomic pointer to a
refcounted rulesSnapshot so queries only hold a snapshot reference
during execution, allowing concurrent rule rebuilds.
2026-04-01 16:23:39 +08:00
世界
bd222fe9df dns: serialize rebuilds and keep last good rules on failure 2026-04-01 16:23:39 +08:00
世界
b44cf24745 docs: fix grammar errors and typos 2026-04-01 16:23:39 +08:00
世界
805f073ffb Suppress SA1019 lint warnings for intentional deprecated field usage 2026-04-01 16:23:39 +08:00
世界
0a85afef25 docs: add evaluate action, response matching fields, and deprecation notices 2026-04-01 16:23:38 +08:00
世界
ccad6d4595 Use typed SVCB hint structs instead of string parsing 2026-04-01 16:23:38 +08:00
世界
f02b50796a option: reject nested rule actions 2026-04-01 16:23:38 +08:00
世界
4df38c3244 dns: make rule strategy legacy-only 2026-04-01 16:23:38 +08:00
世界
036ef04da1 Make DNS match_response fail as a normal condition 2026-04-01 16:23:38 +08:00
世界
876c8eb283 Fix DNS rule-set ref handling 2026-04-01 16:23:37 +08:00
世界
ae2c869310 Fix legacy DNS rule_set accept_empty matching 2026-04-01 16:23:37 +08:00
世界
5dbabe4b37 dns: restore lookup reject semantics 2026-04-01 16:23:37 +08:00
世界
5cc484f34d Fix DNS record parser file inclusion and rule match log index
Remove SetIncludeAllowed(true) from the DNS record zone parser.
The $INCLUDE directive allows opening arbitrary files via os.Open,
which is unnecessary and dangerous when parsing a single record string
from configuration (especially remote profiles).

Fix displayRuleIndex arithmetic in dns/router.go that computed
2*index+1 instead of the correct 0-based index. This was a
reintroduction of a bug previously fixed in be8ee370a. Both
matchDNS and logRuleMatch now use the index directly, matching
the pattern in route/route.go.
2026-04-01 16:23:37 +08:00
世界
a491c9afef Fix DNS record parsing and shutdown race 2026-04-01 16:23:37 +08:00
世界
e09a6d3206 dns: restore init validation and fix rule-set query type 2026-04-01 16:23:37 +08:00
世界
40b9c64a0d dns: make rule path selection rule-set aware 2026-04-01 16:23:37 +08:00
世界
259e67fca3 dns: complete lookup rule execution in new mode 2026-04-01 16:23:36 +08:00
世界
5604488924 Fix legacy DNS negation expansion 2026-04-01 16:23:36 +08:00
世界
abd420be44 dns: isolate legacy pre-match semantics 2026-04-01 16:23:36 +08:00
世界
a0d9c27b44 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-01 16:23:36 +08:00
世界
80965071d9 Remove legacy DNS server formats 2026-04-01 16:23:36 +08:00
世界
8b75fbf83e dns: document non-response rule_set address-filter semantics 2026-04-01 16:23:36 +08:00
世界
58334cfd3c Fix DNS pre-match CIDR fail-closed semantics 2026-04-01 16:23:35 +08:00
世界
04dd0961c4 Fix DNS evaluate regressions 2026-04-01 16:23:35 +08:00
世界
23efd0c961 dns: use response-only address matching 2026-04-01 16:23:35 +08:00
世界
75ddbee71a Fix DNS match_response response address handling 2026-04-01 16:23:35 +08:00
世界
2380ae8506 Fix DNS record parsing and matching regressions 2026-04-01 16:23:35 +08:00
世界
27b60052fe Fix DNS evaluate routing regressions 2026-04-01 16:23:34 +08:00
世界
33e4fcc400 Reorder DNS rule item fields: match_response above address filter and response items, deprecated fields at bottom 2026-04-01 16:23:34 +08:00
世界
034727c3b6 Add evaluate DNS rule action and related rule items 2026-04-01 16:23:34 +08:00
世界
e52c032024 Bump version 2026-04-01 16:22:42 +08:00
世界
f919f490f5 Add BBR profile and hop interval randomization for Hysteria2 2026-04-01 16:22:40 +08:00
nekohasekai
79f9ef04c4 Refactor ACME support to certificate provider 2026-04-01 16:22:40 +08:00
世界
3de5fdb18e cronet-go: Update chromium to 145.0.7632.159 2026-04-01 16:22:39 +08:00
世界
eaf4b6b901 documentation: Update descriptions for neighbor rules 2026-04-01 16:22:39 +08:00
世界
859667d650 Add macOS support for MAC and hostname rule items 2026-04-01 16:22:39 +08:00
世界
a91377b67d Add Android support for MAC and hostname rule items 2026-04-01 16:22:39 +08:00
世界
f7ab050e3e Add MAC and hostname rule items 2026-04-01 16:22:39 +08:00
世界
354b4b040e sing: Fix vectorised readv iovec length calculation
This does not seem to affect any actual paths in the sing-box.
2026-04-01 16:16:58 +08:00
世界
7ffdc48b49 Bump version v1.13.5 2026-03-30 23:03:43 +08:00
世界
e15bdf11eb sing: Minor fixes 2026-03-30 22:58:11 +08:00
世界
e3bcb06c3e platform: Add HTTPResponse.WriteToWithProgress 2026-03-30 22:42:36 +08:00
世界
84d2280960 quic: Fix protocol client close & Sync hysteria bbr fix 2026-03-30 22:42:36 +08:00