wgengine: stop giving tsdns a buffer that will be reused

Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
pull/649/head
Dmytro Shynkevych 4 years ago
parent 9a346fd8b4
commit cb01058a53
No known key found for this signature in database
GPG Key ID: FF5E2F3DAD97EA23

@ -405,7 +405,7 @@ func (e *userspaceEngine) isLocalAddr(ip packet.IP) bool {
func (e *userspaceEngine) handleDNS(p *packet.ParsedPacket, t *tstun.TUN) filter.Response { func (e *userspaceEngine) handleDNS(p *packet.ParsedPacket, t *tstun.TUN) filter.Response {
if p.DstIP == magicDNSIP && p.DstPort == magicDNSPort && p.IPProto == packet.UDP { if p.DstIP == magicDNSIP && p.DstPort == magicDNSPort && p.IPProto == packet.UDP {
request := tsdns.Packet{ request := tsdns.Packet{
Payload: p.Payload(), Payload: append([]byte(nil), p.Payload()...),
Addr: netaddr.IPPort{IP: p.SrcIP.Netaddr(), Port: p.SrcPort}, Addr: netaddr.IPPort{IP: p.SrcIP.Netaddr(), Port: p.SrcPort},
} }
err := e.resolver.EnqueueRequest(request) err := e.resolver.EnqueueRequest(request)

Loading…
Cancel
Save