diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-04-18 16:39:14 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-04-18 16:42:30 +0200 |
commit | 26a56a652eeeece7677ba4f1896da34c83930652 (patch) | |
tree | 27f4a4a2925287dd3087916a867b81882c806c93 /device.go | |
parent | 0b940a756838efcb90363ad99cb085d077b78e96 (diff) |
Allow determining name
Diffstat (limited to 'device.go')
-rw-r--r-- | device.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -255,7 +255,15 @@ func NewDevice(tun TUNDevice, logger *Logger) *Device { device.isClosed.Set(false) device.log = logger + device.tun.device = tun + mtu, err := device.tun.device.MTU() + if err != nil { + logger.Error.Println("Trouble determining MTU, assuming 1420:", err) + mtu = 1420 + } + device.tun.mtu = int32(mtu) + device.peers.keyMap = make(map[NoisePublicKey]*Peer) // initialize anti-DoS / anti-scanning features |