fix tunnel test
This commit is contained in:
		| @@ -433,7 +433,7 @@ func (t *tun) process() { | |||||||
| 				// if the message was being returned by the loopback listener | 				// if the message was being returned by the loopback listener | ||||||
| 				// send it back up the loopback link only | 				// send it back up the loopback link only | ||||||
| 				if msg.loopback && !loopback { | 				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") | 					err = errors.New("link is not loopback") | ||||||
| 					continue | 					continue | ||||||
| 				} | 				} | ||||||
| @@ -460,6 +460,7 @@ func (t *tun) process() { | |||||||
|  |  | ||||||
| 			// no links to send to | 			// no links to send to | ||||||
| 			if len(sendTo) == 0 { | 			if len(sendTo) == 0 { | ||||||
|  | 				log.Log("no links") | ||||||
| 				t.respond(msg, err) | 				t.respond(msg, err) | ||||||
| 				continue | 				continue | ||||||
| 			} | 			} | ||||||
| @@ -683,6 +684,8 @@ func (t *tun) listen(link *link) { | |||||||
| 			t.links[link.Remote()] = link | 			t.links[link.Remote()] = link | ||||||
| 			t.Unlock() | 			t.Unlock() | ||||||
|  |  | ||||||
|  | 			// notify of link change | ||||||
|  | 			go t.notify() | ||||||
| 			// send back an announcement of our channels discovery | 			// send back an announcement of our channels discovery | ||||||
| 			go t.announce("", "", link) | 			go t.announce("", "", link) | ||||||
| 			// ask for the things on the other wise | 			// ask for the things on the other wise | ||||||
| @@ -1076,6 +1079,11 @@ func (t *tun) pickLink(links []*link) *link { | |||||||
| 			continue | 			continue | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  | 		// skip the loopback | ||||||
|  | 		if link.Loopback() { | ||||||
|  | 			continue | ||||||
|  | 		} | ||||||
|  |  | ||||||
| 		// get the link state info | 		// get the link state info | ||||||
| 		d := float64(link.Delay()) | 		d := float64(link.Delay()) | ||||||
| 		l := float64(link.Length()) | 		l := float64(link.Length()) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user