From ae934c19f1c376eb8e97134d8bbd48d28557e315 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Thu, 12 Dec 2019 13:04:34 +0000 Subject: [PATCH] fix tunnel test --- tunnel/default.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tunnel/default.go b/tunnel/default.go index aadd4870..a418fcf1 100644 --- a/tunnel/default.go +++ b/tunnel/default.go @@ -433,7 +433,7 @@ func (t *tun) process() { // if the message was being returned by the loopback listener // send it back up the loopback link only if msg.loopback && !loopback { - log.Tracef("Link for message %s is loopback", id) + log.Tracef("Link for message from %s is loopback", id) err = errors.New("link is not loopback") continue } @@ -460,6 +460,7 @@ func (t *tun) process() { // no links to send to if len(sendTo) == 0 { + log.Log("no links") t.respond(msg, err) continue } @@ -683,6 +684,8 @@ func (t *tun) listen(link *link) { t.links[link.Remote()] = link t.Unlock() + // notify of link change + go t.notify() // send back an announcement of our channels discovery go t.announce("", "", link) // ask for the things on the other wise @@ -1076,6 +1079,11 @@ func (t *tun) pickLink(links []*link) *link { continue } + // skip the loopback + if link.Loopback() { + continue + } + // get the link state info d := float64(link.Delay()) l := float64(link.Length())