Skip to content

Commit e0efa50

Browse files
committed
conn: linux: unexport mutex
Signed-off-by: Jason A. Donenfeld <[email protected]>
1 parent 6017552 commit e0efa50

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

conn/bind_linux.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type ipv6Source struct {
2727
}
2828

2929
type LinuxSocketEndpoint struct {
30-
sync.Mutex
30+
mu sync.Mutex
3131
dst [unsafe.Sizeof(unix.SockaddrInet6{})]byte
3232
src [unsafe.Sizeof(ipv6Source{})]byte
3333
isV6 bool
@@ -450,9 +450,9 @@ func send4(sock int, end *LinuxSocketEndpoint, buff []byte) error {
450450
},
451451
}
452452

453-
end.Lock()
453+
end.mu.Lock()
454454
_, err := unix.SendmsgN(sock, buff, (*[unsafe.Sizeof(cmsg)]byte)(unsafe.Pointer(&cmsg))[:], end.dst4(), 0)
455-
end.Unlock()
455+
end.mu.Unlock()
456456

457457
if err == nil {
458458
return nil
@@ -463,9 +463,9 @@ func send4(sock int, end *LinuxSocketEndpoint, buff []byte) error {
463463
if err == unix.EINVAL {
464464
end.ClearSrc()
465465
cmsg.pktinfo = unix.Inet4Pktinfo{}
466-
end.Lock()
466+
end.mu.Lock()
467467
_, err = unix.SendmsgN(sock, buff, (*[unsafe.Sizeof(cmsg)]byte)(unsafe.Pointer(&cmsg))[:], end.dst4(), 0)
468-
end.Unlock()
468+
end.mu.Unlock()
469469
}
470470

471471
return err
@@ -494,9 +494,9 @@ func send6(sock int, end *LinuxSocketEndpoint, buff []byte) error {
494494
cmsg.pktinfo.Ifindex = 0
495495
}
496496

497-
end.Lock()
497+
end.mu.Lock()
498498
_, err := unix.SendmsgN(sock, buff, (*[unsafe.Sizeof(cmsg)]byte)(unsafe.Pointer(&cmsg))[:], end.dst6(), 0)
499-
end.Unlock()
499+
end.mu.Unlock()
500500

501501
if err == nil {
502502
return nil
@@ -507,9 +507,9 @@ func send6(sock int, end *LinuxSocketEndpoint, buff []byte) error {
507507
if err == unix.EINVAL {
508508
end.ClearSrc()
509509
cmsg.pktinfo = unix.Inet6Pktinfo{}
510-
end.Lock()
510+
end.mu.Lock()
511511
_, err = unix.SendmsgN(sock, buff, (*[unsafe.Sizeof(cmsg)]byte)(unsafe.Pointer(&cmsg))[:], end.dst6(), 0)
512-
end.Unlock()
512+
end.mu.Unlock()
513513
}
514514

515515
return err

0 commit comments

Comments
 (0)