integration/xdp: use kernel-allocated port

reviewable/pr804/r1
Tamir Duberstein 12 months ago
parent 64d9799efc
commit 062ebfdc68
No known key found for this signature in database

@ -84,10 +84,11 @@ fn cpumap_chain() {
const PAYLOAD: &str = "hello cpumap";
let sock = UdpSocket::bind("127.0.0.1:1777").unwrap();
let sock = UdpSocket::bind("127.0.0.1:0").unwrap();
let addr = sock.local_addr().unwrap();
sock.set_read_timeout(Some(Duration::from_millis(1)))
.unwrap();
sock.send_to(PAYLOAD.as_bytes(), "127.0.0.1:1777").unwrap();
sock.send_to(PAYLOAD.as_bytes(), addr).unwrap();
// Read back the packet to ensure it went through the entire network stack, including our two
// probes.

Loading…
Cancel
Save