Commit Graph

28 Commits

Author SHA1 Message Date
Berkay Özdemirci
0b8746a133 Fix EDNS OPT record corruption in DNS cache
The TTL computation and assignment loops treat OPT record's Hdr.Ttl
as a regular TTL, but per RFC 6891 it encodes EDNS0 metadata
(ExtRCode|Version|Flags). This corrupts cached responses causing
systemd-resolved to reject them with EDNS version 255.

Also fix pointer aliasing: storeCache() stored raw *dns.Msg pointer
so subsequent mutations by Exchange() corrupted cached data.

- Skip OPT records in all TTL loops (Exchange + loadResponse)
- Use message.Copy() in storeCache() to isolate cache from mutations
2026-04-10 14:08:24 +08:00
世界
4984fc05bc Fix legacy DNS client_subnet options not working 2026-03-09 20:18:47 +08:00
世界
798e5cbec6 Fix rule_set_ip_cidr_accept_empty not working 2026-03-04 11:48:22 +08:00
世界
dd067b6e75 Fix DNS cache lock goroutine leak
The cache deduplication in Client.Exchange uses a channel-based lock
per DNS question. Waiting goroutines blocked on <-cond without context
awareness, causing them to accumulate indefinitely when the owning
goroutine's transport call stalls. Add select on ctx.Done() so waiters
respect context cancellation and timeouts.
2026-02-06 22:28:35 +08:00
世界
4eb91d69fe 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
世界
eb4cacec06 Fix DNS negative caching to comply with RFC 2308 2025-10-09 23:45:23 +08:00
Mahdi
e331ae8a92 Fix dns cache in lookup 2025-10-09 23:45:23 +08:00
世界
475dc17c8a Do not cache DNS responses with empty answers 2025-09-13 03:04:08 +08:00
世界
709cdc1f95 Fix DNS exchange 2025-09-12 18:05:02 +08:00
世界
bce6af069f Treat requests with OPT extra but no options as simple requests 2025-09-08 09:12:30 +08:00
世界
45387f3231 Fix DNS client 2025-09-08 09:12:30 +08:00
世界
38c5d92a0c Fix DNS cache 2025-09-08 09:12:30 +08:00
世界
c9064a4d34 Fix DNS reject check 2025-07-08 13:14:46 +08:00
世界
8dd9c55c1e Fix dns.client_subnet ignored 2025-07-08 13:14:43 +08:00
世界
ca912aa72f Add resolved service and DNS server 2025-07-08 13:14:41 +08:00
世界
6a244312ed Fix set edns0 client subnet 2025-07-08 13:14:38 +08:00
世界
7f583a3508 Handle EDNS version downgrade 2025-07-08 13:12:35 +08:00
世界
a296b1da3f Fix DNS lookup 2025-07-08 13:12:33 +08:00
k9982874
fe2239266a Fix hosts DNS server 2025-07-08 13:12:24 +08:00
世界
2a623c4b2f Add fallback local DNS server for iOS 2025-07-08 13:12:18 +08:00
世界
f75ade1991 refactor: DNS 2025-07-08 13:12:14 +08:00
世界
3d16df288c Migrate components to library 2022-07-11 18:44:59 +08:00
世界
f548511d7e Make dns.strategy take effect in dns exchange 2022-07-11 13:21:17 +08:00
世界
70901c0946 Minor fixes 2022-07-10 16:19:42 +08:00
世界
2cc746aafe Update gci format 2022-07-08 23:03:57 +08:00
世界
0cc16a7836 Add dial parallel for outbound dialer 2022-07-08 13:08:29 +08:00
世界
d921797e3c Add disableCache/disableExpire option for dns client 2022-07-06 23:43:20 +08:00
世界
001dc5f62c Add dns client 2022-07-06 23:14:19 +08:00