Fix lint errors

This commit is contained in:
Neil Alexander 2021-06-02 14:40:09 +01:00
parent 166336a418
commit 8932ab0519
14 changed files with 44 additions and 54 deletions

View file

@ -123,16 +123,12 @@ func (tun *TunAdapter) write() {
continue // bad remote address/subnet
}
bs = buf[:TUN_OFFSET_BYTES+len(bs)]
n, err = tun.iface.Write(bs, TUN_OFFSET_BYTES)
if err != nil {
if _, err = tun.iface.Write(bs, TUN_OFFSET_BYTES); err != nil {
tun.Act(nil, func() {
if !tun.isOpen {
tun.log.Errorln("TUN iface write error:", err)
}
})
}
if n != len(bs) {
// TODO some kind of error reporting for a partial write
}
}
}