fix channel routing exiting after first packet. fix packet channel type not being injected
This commit is contained in:
parent
a132ecb6fa
commit
16a95dc7d8
1 changed files with 11 additions and 8 deletions
|
|
@ -209,6 +209,7 @@ func channelReceiver(r *LuxRouter, channel *LuxChannel) {
|
|||
var dgram LuxDatagram
|
||||
var err error
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-channel.control:
|
||||
return
|
||||
|
|
@ -221,6 +222,7 @@ func channelReceiver(r *LuxRouter, channel *LuxChannel) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (r *LuxRouter) Start() {
|
||||
r.channelLock.RLock()
|
||||
|
|
@ -340,6 +342,7 @@ func (r *LuxRouter) Recv() (LuxPacket, error) {
|
|||
}
|
||||
|
||||
// packet arrived to right route and successfully decrypted
|
||||
packet.ChannelType = dgram.Channel.Type
|
||||
return packet, nil
|
||||
} else {
|
||||
// first time seeing peer - bruteforce keys from keystore
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue