mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-11-30 13:35:19 +00:00
Parameterise tun.init
This commit is contained in:
parent
1a7df477b0
commit
9eaa2566c1
@ -80,13 +80,10 @@ func (r *router) init(core *Core) {
|
|||||||
send := make(chan []byte, 32)
|
send := make(chan []byte, 32)
|
||||||
r.recv = recv
|
r.recv = recv
|
||||||
r.send = send
|
r.send = send
|
||||||
r.tun.recv = recv
|
|
||||||
r.tun.send = send
|
|
||||||
r.reset = make(chan struct{}, 1)
|
r.reset = make(chan struct{}, 1)
|
||||||
r.admin = make(chan func(), 32)
|
r.admin = make(chan func(), 32)
|
||||||
r.cryptokey.init(r.core)
|
r.cryptokey.init(r.core)
|
||||||
r.tun.init(r.core)
|
r.tun.init(r.core, send, recv)
|
||||||
// go r.mainLoop()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Starts the mainLoop goroutine.
|
// Starts the mainLoop goroutine.
|
||||||
|
@ -36,9 +36,11 @@ func getSupportedMTU(mtu int) int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Initialises the TUN/TAP adapter.
|
// Initialises the TUN/TAP adapter.
|
||||||
func (tun *tunDevice) init(core *Core) {
|
func (tun *tunDevice) init(core *Core, send chan<- []byte, recv <-chan []byte) {
|
||||||
tun.core = core
|
tun.core = core
|
||||||
tun.icmpv6.init(tun)
|
tun.icmpv6.init(tun)
|
||||||
|
tun.send = send
|
||||||
|
tun.recv = recv
|
||||||
}
|
}
|
||||||
|
|
||||||
// Starts the setup process for the TUN/TAP adapter, and if successful, starts
|
// Starts the setup process for the TUN/TAP adapter, and if successful, starts
|
||||||
|
Loading…
Reference in New Issue
Block a user