Skip to content

Commit

Permalink
LongLivedConnections: add setsockopt IP_BIND_ADDRESS_NO_PORT
Browse files Browse the repository at this point in the history
Signed-off-by: Ondrej Lichtner <[email protected]>
  • Loading branch information
olichtne committed Aug 22, 2024
1 parent b073cad commit 38f042c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lnst/Tests/LongLivedConnections.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 38f042c

Please sign in to comment.