This PR fixes various tunnel race conditions

This commit is contained in:
Milos Gajdos
2019-12-05 15:50:32 +00:00
parent 18cf025056
commit 5db7514a91
5 changed files with 78 additions and 62 deletions

View File

@@ -854,16 +854,6 @@ func (t *tun) connect() error {
}
}()
// setup links
t.setupLinks()
// process outbound messages to be sent
// process sends to all links
go t.process()
// monitor links
go t.monitor()
return nil
}
@@ -889,6 +879,16 @@ func (t *tun) Connect() error {
// create new close channel
t.closed = make(chan bool)
// setup links
t.setupLinks()
// process outbound messages to be sent
// process sends to all links
go t.process()
// monitor links
go t.monitor()
return nil
}