summaryrefslogtreecommitdiffhomepage
path: root/conn/bind_linux.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-03-06 09:20:46 -0700
committerJason A. Donenfeld <Jason@zx2c4.com>2021-03-08 21:04:09 -0700
commit0eb720629553800b351c8ac7f6aa5ffad3de427d (patch)
treeed0da32f3dfe58201571dad3b0b677d47b3ec734 /conn/bind_linux.go
parent20714ca4727547ed641f4570ef96f87796485e95 (diff)
conn: linux: unexport mutex
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'conn/bind_linux.go')
-rw-r--r--conn/bind_linux.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/conn/bind_linux.go b/conn/bind_linux.go
index 4199809..70ea609 100644
--- a/conn/bind_linux.go
+++ b/conn/bind_linux.go
@@ -27,7 +27,7 @@ type ipv6Source struct {
}
type LinuxSocketEndpoint struct {
- sync.Mutex
+ mu sync.Mutex
dst [unsafe.Sizeof(unix.SockaddrInet6{})]byte
src [unsafe.Sizeof(ipv6Source{})]byte
isV6 bool
@@ -450,9 +450,9 @@ func send4(sock int, end *LinuxSocketEndpoint, buff []byte) error {
},
}
- end.Lock()
+ end.mu.Lock()
_, err := unix.SendmsgN(sock, buff, (*[unsafe.Sizeof(cmsg)]byte)(unsafe.Pointer(&cmsg))[:], end.dst4(), 0)
- end.Unlock()
+ end.mu.Unlock()
if err == nil {
return nil
@@ -463,9 +463,9 @@ func send4(sock int, end *LinuxSocketEndpoint, buff []byte) error {
if err == unix.EINVAL {
end.ClearSrc()
cmsg.pktinfo = unix.Inet4Pktinfo{}
- end.Lock()
+ end.mu.Lock()
_, err = unix.SendmsgN(sock, buff, (*[unsafe.Sizeof(cmsg)]byte)(unsafe.Pointer(&cmsg))[:], end.dst4(), 0)
- end.Unlock()
+ end.mu.Unlock()
}
return err
@@ -494,9 +494,9 @@ func send6(sock int, end *LinuxSocketEndpoint, buff []byte) error {
cmsg.pktinfo.Ifindex = 0
}
- end.Lock()
+ end.mu.Lock()
_, err := unix.SendmsgN(sock, buff, (*[unsafe.Sizeof(cmsg)]byte)(unsafe.Pointer(&cmsg))[:], end.dst6(), 0)
- end.Unlock()
+ end.mu.Unlock()
if err == nil {
return nil
@@ -507,9 +507,9 @@ func send6(sock int, end *LinuxSocketEndpoint, buff []byte) error {
if err == unix.EINVAL {
end.ClearSrc()
cmsg.pktinfo = unix.Inet6Pktinfo{}
- end.Lock()
+ end.mu.Lock()
_, err = unix.SendmsgN(sock, buff, (*[unsafe.Sizeof(cmsg)]byte)(unsafe.Pointer(&cmsg))[:], end.dst6(), 0)
- end.Unlock()
+ end.mu.Unlock()
}
return err