diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2017-11-14 18:26:28 +0100 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2017-11-14 18:26:28 +0100 |
commit | 88801529fd4097993f7c448b1c3eee0abc8cb51c (patch) | |
tree | d1750dc52489b7d5c665918ae522aae5b8fc4f6b /src/device.go | |
parent | 69fe86edf0ba371b9b0a54e522ec20d33e0ae129 (diff) |
Moved TUN device creation to pre-fork
Diffstat (limited to 'src/device.go')
-rw-r--r-- | src/device.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/device.go b/src/device.go index 9422d49..429ee46 100644 --- a/src/device.go +++ b/src/device.go @@ -126,13 +126,13 @@ func (device *Device) PutMessageBuffer(msg *[MaxMessageSize]byte) { device.pool.messageBuffers.Put(msg) } -func NewDevice(tun TUNDevice, logLevel int) *Device { +func NewDevice(tun TUNDevice, logger *Logger) *Device { device := new(Device) device.mutex.Lock() defer device.mutex.Unlock() - device.log = NewLogger(logLevel, "("+tun.Name()+") ") + device.log = logger device.peers = make(map[NoisePublicKey]*Peer) device.tun.device = tun |