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 authored and enhaut committed Aug 16, 2024
1 parent ea74c13 commit 7883ac4
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 @@ -86,7 +86,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 @@ -159,6 +159,7 @@ def _stop(self):

def _start_connection(self):
sck = socket.socket(get_af(self.params.server_ip), socket.SOCK_STREAM)
sck.setsockopt(socket.IPPROTO_IP, 0x18, 1)
sck.bind(
(self.params.client_ip, 0)
) # needs to be binded to specific IP to respect flow IPs
Expand Down

0 comments on commit 7883ac4

Please sign in to comment.