You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix MITM using unique source ports for each server-side connection (finos#577)
* Fix MITM using unique source ports for each server-side connection
Each new client SYN now increments the server-side source port so the
server sees a distinct 4-tuple per client/reconnection, avoiding TCP
state machine corruption when clients reconnect.
The packet filter is updated to accept packets on the current
server_conn.local_port in addition to mitm_port, so server responses
to the unique port are not dropped.
Closesfinos#576
* Disable Python stdout buffering in embedded interpreter
Python's stdout is block-buffered when connected to a pipe (e.g. ctest
in CI). Forked child processes exit via std::exit() without calling
Py_Finalize(), so Python's internal BufferedWriter is never flushed and
all print() output is silently dropped.
Use Py_UnbufferedStdioFlag on Python < 3.12 and PyConfig.buffered_stdio
on Python >= 3.12 (where the flag is deprecated) to make stdout
unbuffered before Py_Initialize().
* Re-enable UVYMQMitmTest/Reconnect on Windows
The test was disabled in finos#576 due to TCP state machine corruption caused
by the MITM always reusing the same source port for server-side
connections. This is fixed by the unique-port counter introduced in this
branch.
* Consolidate MITM platform IP selection into getMitmIPs() helper
Removes repeated #ifdef __linux__ / _WIN32 blocks from each MITM test
by introducing a MitmIPs struct and getMitmIPs() in testing.h/cpp.
* Assign static unique ports to MITM tests, remove randomPort()
Replaces randomPort() calls with fixed ports 23575-23578 for the four
MITM tests, matching the pattern of the existing static remote_ports
(23571-23574). Removes the now-unused randomPort() utility.
* Apply getMitmIPs() and static ports to uv_ymq MITM tests
Same cleanup as done for test_ymq.cpp: replace repeated #ifdef blocks
with getMitmIPs() and assign static unique mitm ports (23579-23582).
0 commit comments