From 062ebfdc68146b4b705c44a2c76cd6624f8c3730 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Mon, 2 Oct 2023 16:09:03 -0400 Subject: [PATCH] integration/xdp: use kernel-allocated port --- test/integration-test/src/tests/xdp.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/integration-test/src/tests/xdp.rs b/test/integration-test/src/tests/xdp.rs index e66b497f..780fe465 100644 --- a/test/integration-test/src/tests/xdp.rs +++ b/test/integration-test/src/tests/xdp.rs @@ -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.