mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-08-07 06:15:15 +03:00
dns: Fix search domain expansion
DHCP option 119/15 and resolved link domains are not rooted, so appending them to the query name produced a non-FQDN name, failing to pack with "domain must be fully qualified".
This commit is contained in:
@@ -296,9 +296,14 @@ func (t *Transport) fetchServersResponse(iface *control.Interface, packetConn ne
|
||||
func (t *Transport) recreateServers(iface *control.Interface, dhcpPacket *dhcpv4.DHCPv4) error {
|
||||
searchList := dhcpPacket.DomainSearch()
|
||||
if searchList != nil && len(searchList.Labels) > 0 {
|
||||
t.search = searchList.Labels
|
||||
t.search = common.Filter(common.Map(searchList.Labels, mDNS.Fqdn), func(it string) bool {
|
||||
return it != "."
|
||||
})
|
||||
} else if dhcpPacket.DomainName() != "" {
|
||||
t.search = []string{dhcpPacket.DomainName()}
|
||||
domainName := mDNS.Fqdn(dhcpPacket.DomainName())
|
||||
if domainName != "." {
|
||||
t.search = []string{domainName}
|
||||
}
|
||||
}
|
||||
serverAddrs := common.Map(dhcpPacket.DNS(), func(it net.IP) M.Socksaddr {
|
||||
return M.SocksaddrFrom(M.AddrFromIP(it), 53)
|
||||
|
||||
Reference in New Issue
Block a user