chore: better dns log
This commit is contained in:
15
dns/dhcp.go
15
dns/dhcp.go
@ -2,12 +2,14 @@ package dns
|
||||
|
||||
import (
|
||||
"context"
|
||||
"go.uber.org/atomic"
|
||||
"net"
|
||||
"net/netip"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"go.uber.org/atomic"
|
||||
|
||||
"github.com/Dreamacro/clash/component/dhcp"
|
||||
"github.com/Dreamacro/clash/component/iface"
|
||||
"github.com/Dreamacro/clash/component/resolver"
|
||||
@ -34,6 +36,17 @@ type dhcpClient struct {
|
||||
err error
|
||||
}
|
||||
|
||||
var _ dnsClient = (*dhcpClient)(nil)
|
||||
|
||||
// Address implements dnsClient
|
||||
func (d *dhcpClient) Address() string {
|
||||
addrs := make([]string, 0)
|
||||
for _, c := range d.clients {
|
||||
addrs = append(addrs, c.Address())
|
||||
}
|
||||
return strings.Join(addrs, ",")
|
||||
}
|
||||
|
||||
func (d *dhcpClient) Exchange(m *D.Msg) (msg *D.Msg, err error) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), resolver.DefaultDNSTimeout)
|
||||
defer cancel()
|
||||
|
Reference in New Issue
Block a user