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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user