mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 21:27:31 +00:00
all: fix resource leaks with missing .Close() calls
Fixes #5706 Signed-off-by: Emmanuel T Odeke <emmanuel@orijtech.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
9bdf0cd8cd
commit
f981b1d9da
@@ -987,16 +987,19 @@ func (ns *Impl) acceptUDP(r *udp.ForwarderRequest) {
|
||||
}
|
||||
dstAddr, ok := ipPortOfNetstackAddr(sess.LocalAddress, sess.LocalPort)
|
||||
if !ok {
|
||||
ep.Close()
|
||||
return
|
||||
}
|
||||
srcAddr, ok := ipPortOfNetstackAddr(sess.RemoteAddress, sess.RemotePort)
|
||||
if !ok {
|
||||
ep.Close()
|
||||
return
|
||||
}
|
||||
|
||||
// Handle magicDNS traffic (via UDP) here.
|
||||
if dst := dstAddr.Addr(); dst == magicDNSIP || dst == magicDNSIPv6 {
|
||||
if dstAddr.Port() != 53 {
|
||||
ep.Close()
|
||||
return // Only MagicDNS traffic runs on the service IPs for now.
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user