mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-23 17:18:42 +00:00
control/controlclient: add temporary mechanism to force derp on
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
@@ -13,6 +13,8 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
@@ -376,6 +378,8 @@ func shouldSprayPacket(b []byte) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
var logPacketDests, _ = strconv.ParseBool(os.Getenv("DEBUG_LOG_PACKET_DESTS"))
|
||||
|
||||
// appendDests appends to dsts the destinations that b should be
|
||||
// written to in order to reach as. Some of the returned UDPAddrs may
|
||||
// be fake addrs representing DERP servers.
|
||||
@@ -403,6 +407,9 @@ func appendDests(dsts []*net.UDPAddr, as *AddrSet, b []byte) (_ []*net.UDPAddr,
|
||||
break
|
||||
}
|
||||
}
|
||||
if logPacketDests {
|
||||
log.Printf("spray=%v; roam=%v; dests=%v", spray, roamAddr, dsts)
|
||||
}
|
||||
return dsts, roamAddr
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user