Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compile error: Make IOV live longer #163

Merged
merged 12 commits into from
Sep 13, 2023
7 changes: 4 additions & 3 deletions src/adapters/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,10 @@ impl LocalResource {
let mut control_buffer = nix::cmsg_space!(libc::sockaddr_storage);

loop {
let mut iov = [io::IoSliceMut::new(&mut input_buffer)];
let result = socket::recvmsg::<SockaddrStorage>(
self.socket.as_raw_fd(),
&mut [io::IoSliceMut::new(&mut input_buffer)],
&mut iov,
Some(&mut control_buffer),
MsgFlags::empty(),
);
Expand Down Expand Up @@ -385,15 +386,15 @@ impl Local for LocalResource {
Some(ingress_addresses)
}
}
}
}
lemunozm marked this conversation as resolved.
Show resolved Hide resolved
else {
None
};

if let Some(multicast) = multicast {
socket.join_multicast_v4(multicast.ip(), &Ipv4Addr::UNSPECIFIED)?;
socket.bind(&SocketAddrV4::new(Ipv4Addr::UNSPECIFIED, addr.port()).into())?;
}
}
lemunozm marked this conversation as resolved.
Show resolved Hide resolved
else {
socket.bind(&addr.into())?;
}
Expand Down
Loading