diff --git a/src/yggdrasil/router.go b/src/yggdrasil/router.go index 7701286..4eaa56d 100644 --- a/src/yggdrasil/router.go +++ b/src/yggdrasil/router.go @@ -166,8 +166,8 @@ func (r *router) handleTraffic(packet []byte) { return } select { - case sinfo.fromRouter <- &p: // FIXME ideally this should be front drop - default: + case sinfo.fromRouter <- &p: + case <-sinfo.cancel.Finished(): util.PutBytes(p.Payload) } } diff --git a/src/yggdrasil/session.go b/src/yggdrasil/session.go index 161d8ed..c17fb04 100644 --- a/src/yggdrasil/session.go +++ b/src/yggdrasil/session.go @@ -227,7 +227,7 @@ func (ss *sessions) createSession(theirPermKey *crypto.BoxPubKey) *sessionInfo { sinfo.myHandle = *crypto.NewHandle() sinfo.theirAddr = *address.AddrForNodeID(crypto.GetNodeID(&sinfo.theirPermPub)) sinfo.theirSubnet = *address.SubnetForNodeID(crypto.GetNodeID(&sinfo.theirPermPub)) - sinfo.fromRouter = make(chan *wire_trafficPacket, 32) + sinfo.fromRouter = make(chan *wire_trafficPacket, 1) sinfo.recv = make(chan []byte, 32) sinfo.send = make(chan []byte, 32) ss.sinfos[sinfo.myHandle] = &sinfo