From 1a2b7a8b60985ed82681f5faefd51932ededde0b Mon Sep 17 00:00:00 2001 From: Arceliar Date: Wed, 14 Aug 2019 17:57:36 -0500 Subject: [PATCH] test a change to how switch hops are selected when multiple links are idle --- src/yggdrasil/switch.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/yggdrasil/switch.go b/src/yggdrasil/switch.go index b53229c..adc49ab 100644 --- a/src/yggdrasil/switch.go +++ b/src/yggdrasil/switch.go @@ -676,7 +676,8 @@ func (t *switchTable) handleIn(packet []byte, idle map[switchPort]time.Time) boo update = true case cinfo.dist > bestDist: //nothing - case thisTime.Before(bestTime): + case thisTime.After(bestTime): + // Pick the one that was used most recently -- at least this should pick the same link consistently in low-traffic scenarios update = true default: //nothing