From 0eb720629553800b351c8ac7f6aa5ffad3de427d Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sat, 6 Mar 2021 09:20:46 -0700 Subject: conn: linux: unexport mutex Signed-off-by: Jason A. Donenfeld --- conn/bind_linux.go | 18 +++++++++--------- 1 file 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 -- cgit v1.2.3