Fixed bug, msg_controllen is size_t type

This commit is contained in:
zonyitoo
2020-02-02 23:34:53 +08:00
parent 73013ae970
commit 0fa1be898f
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -124,7 +124,7 @@ pub fn recv_from_with_destination(socket: &UdpSocket, buf: &mut [u8]) -> io::Res
msg.msg_iovlen = 1;
msg.msg_control = control_buf.as_mut_ptr() as *mut _;
msg.msg_controllen = control_buf.len() as libc::socklen_t;
msg.msg_controllen = control_buf.len() as libc::size_t;
let fd = socket.as_raw_fd();
let ret = libc::recvmsg(fd, &mut msg, 0);
+1 -1
View File
@@ -111,7 +111,7 @@ pub fn recv_from_with_destination(socket: &UdpSocket, buf: &mut [u8]) -> io::Res
msg.msg_iovlen = 1;
msg.msg_control = control_buf.as_mut_ptr() as *mut _;
msg.msg_controllen = control_buf.len() as libc::socklen_t;
msg.msg_controllen = control_buf.len() as libc::size_t;
let fd = socket.as_raw_fd();
let ret = libc::recvmsg(fd, &mut msg, 0);