From 2d99f8678084b9b4556f730b3125a68bc9c0956f Mon Sep 17 00:00:00 2001 From: adlyq <2833154405@qq.com> Date: Thu, 28 Apr 2022 23:44:37 +0800 Subject: [PATCH] fix: dhcp ifacename type --- dns/dhcp.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dns/dhcp.go b/dns/dhcp.go index e0d6c7f0..a4ad70a5 100644 --- a/dns/dhcp.go +++ b/dns/dhcp.go @@ -2,6 +2,7 @@ package dns import ( "context" + "go.uber.org/atomic" "net" "net/netip" "sync" @@ -71,7 +72,7 @@ func (d *dhcpClient) resolve(ctx context.Context) (*Resolver, error) { for _, item := range dns { nameserver = append(nameserver, NameServer{ Addr: net.JoinHostPort(item.String(), "53"), - Interface: d.ifaceName, + Interface: atomic.NewString(d.ifaceName), }) }