1
0
mirror of https://github.com/fumiama/water.git synced 2026-06-08 12:10:27 +08:00

darwin: Adds Check Empty Writes to TUN

This commit is contained in:
Matthew Ellison
2017-05-22 12:00:06 -04:00
parent da7e7e0a3e
commit 4112fb9cd7

View File

@@ -151,6 +151,11 @@ func (t *tunReadCloser) Read(to []byte) (int, error) {
}
func (t *tunReadCloser) Write(from []byte) (int, error) {
if len(from) == 0 {
return 0, syscall.EIO
}
t.wMu.Lock()
defer t.wMu.Unlock()