From 38f042c760820830ee5ada9fd5e299e3fd2f1e24 Mon Sep 17 00:00:00 2001 From: Ondrej Lichtner Date: Thu, 15 Aug 2024 10:20:56 +0200 Subject: [PATCH] LongLivedConnections: add setsockopt IP_BIND_ADDRESS_NO_PORT Signed-off-by: Ondrej Lichtner --- lnst/Tests/LongLivedConnections.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lnst/Tests/LongLivedConnections.py b/lnst/Tests/LongLivedConnections.py index c84cae213..ff37256d5 100644 --- a/lnst/Tests/LongLivedConnections.py +++ b/lnst/Tests/LongLivedConnections.py @@ -71,7 +71,7 @@ def _stop(self): self._listening_thread.join() self._polling_thread.join() - + self._result = ( True if len(self._connections) == self.params.connections_count else False ) @@ -144,6 +144,7 @@ def _stop(self): def _start_connection(self): sck = socket.socket(self.params.server_ip.family, socket.SOCK_STREAM) + sck.setsockopt(socket.IPPROTO_IP, 0x18, 1) sck.bind( (str(self.params.client_ip), 0) ) # needs to be binded to specific IP to respect flow IPs