aboutsummaryrefslogtreecommitdiff
path: root/tun/tun_darwin.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2023-03-13 17:55:05 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2023-03-13 17:55:53 +0100
commit0ad14a89f5f9da577dae6a63ad196015e51a0381 (patch)
treeda74ec4dd4dd79b3577236bc30b42ea999e8516b /tun/tun_darwin.go
parent7d327ed35aef08e2f54c12645a3002c94c6aec91 (diff)
downloadwireguard-go-0ad14a89f5f9da577dae6a63ad196015e51a0381.tar.gz
wireguard-go-0ad14a89f5f9da577dae6a63ad196015e51a0381.zip
global: buff -> buf
This always struck me as kind of weird and non-standard. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'tun/tun_darwin.go')
-rw-r--r--tun/tun_darwin.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/tun/tun_darwin.go b/tun/tun_darwin.go
index b927e6f..c9a6c0b 100644
--- a/tun/tun_darwin.go
+++ b/tun/tun_darwin.go
@@ -217,7 +217,7 @@ func (tun *NativeTun) Events() <-chan Event {
return tun.events
}
-func (tun *NativeTun) Read(buffs [][]byte, sizes []int, offset int) (int, error) {
+func (tun *NativeTun) Read(bufs [][]byte, sizes []int, offset int) (int, error) {
// TODO: the BSDs look very similar in Read() and Write(). They should be
// collapsed, with platform-specific files containing the varying parts of
// their implementations.
@@ -225,8 +225,8 @@ func (tun *NativeTun) Read(buffs [][]byte, sizes []int, offset int) (int, error)
case err := <-tun.errors:
return 0, err
default:
- buff := buffs[0][offset-4:]
- n, err := tun.tunFile.Read(buff[:])
+ buf := bufs[0][offset-4:]
+ n, err := tun.tunFile.Read(buf[:])
if n < 4 {
return 0, err
}
@@ -235,11 +235,11 @@ func (tun *NativeTun) Read(buffs [][]byte, sizes []int, offset int) (int, error)
}
}
-func (tun *NativeTun) Write(buffs [][]byte, offset int) (int, error) {
+func (tun *NativeTun) Write(bufs [][]byte, offset int) (int, error) {
if offset < 4 {
return 0, io.ErrShortBuffer
}
- for i, buf := range buffs {
+ for i, buf := range bufs {
buf = buf[offset-4:]
buf[0] = 0x00
buf[1] = 0x00
@@ -256,7 +256,7 @@ func (tun *NativeTun) Write(buffs [][]byte, offset int) (int, error) {
return i, err
}
}
- return len(buffs), nil
+ return len(bufs), nil
}
func (tun *NativeTun) Close() error {