Jay Wren 11 месяцев назад
Родитель
Сommit
a62ffca975
3 измененных файлов с 6 добавлено и 6 удалено
  1. 2 2
      udp/udp_linux.go
  2. 2 2
      udp/udp_linux_32.go
  3. 2 2
      udp/udp_linux_64.go

+ 2 - 2
udp/udp_linux.go

@@ -308,7 +308,7 @@ func (u *StdConn) writeMulti4(packets [][]byte, addrs []netip.AddrPort) (int, er
 
 			// Setup the packet buffer
 			iovecs[i].Base = &packets[pktIdx][0]
-			iovecs[i].Len = uint64(len(packets[pktIdx]))
+			iovecs[i].Len = uint(len(packets[pktIdx]))
 
 			// Setup the destination address
 			rsa := (*unix.RawSockaddrInet4)(unsafe.Pointer(&names[i][0]))
@@ -365,7 +365,7 @@ func (u *StdConn) writeMulti6(packets [][]byte, addrs []netip.AddrPort) (int, er
 
 			// Setup the packet buffer
 			iovecs[i].Base = &packets[pktIdx][0]
-			iovecs[i].Len = uint64(len(packets[pktIdx]))
+			iovecs[i].Len = uint(len(packets[pktIdx]))
 
 			// Setup the destination address
 			rsa := (*unix.RawSockaddrInet6)(unsafe.Pointer(&names[i][0]))

+ 2 - 2
udp/udp_linux_32.go

@@ -12,7 +12,7 @@ import (
 
 type iovec struct {
 	Base *byte
-	Len  uint32
+	Len  uint
 }
 
 type msghdr struct {
@@ -40,7 +40,7 @@ func (u *StdConn) PrepareRawMessages(n int) ([]rawMessage, [][]byte, [][]byte) {
 		names[i] = make([]byte, unix.SizeofSockaddrInet6)
 
 		vs := []iovec{
-			{Base: &buffers[i][0], Len: uint32(len(buffers[i]))},
+			{Base: &buffers[i][0], Len: uint(len(buffers[i]))},
 		}
 
 		msgs[i].Hdr.Iov = &vs[0]

+ 2 - 2
udp/udp_linux_64.go

@@ -12,7 +12,7 @@ import (
 
 type iovec struct {
 	Base *byte
-	Len  uint64
+	Len  uint
 }
 
 type msghdr struct {
@@ -43,7 +43,7 @@ func (u *StdConn) PrepareRawMessages(n int) ([]rawMessage, [][]byte, [][]byte) {
 		names[i] = make([]byte, unix.SizeofSockaddrInet6)
 
 		vs := []iovec{
-			{Base: &buffers[i][0], Len: uint64(len(buffers[i]))},
+			{Base: &buffers[i][0], Len: uint(len(buffers[i]))},
 		}
 
 		msgs[i].Hdr.Iov = &vs[0]