]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
conn: linux: unexport mutex
authorJason A. Donenfeld <Jason@zx2c4.com>
Sat, 6 Mar 2021 16:20:46 +0000 (09:20 -0700)
committerJason A. Donenfeld <Jason@zx2c4.com>
Tue, 9 Mar 2021 04:04:09 +0000 (21:04 -0700)
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
conn/bind_linux.go

index 41998095190296aa7c28b0869df5b30fc625bca0..70ea609d63cb519f7776757f2ea1021af2166122 100644 (file)
@@ -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