Closed jamesdillonharvey closed 9 months ago
This needs to be fixed: https://github.com/zeromq/libzmq/actions/runs/6468544183/job/17560783020?pr=4599
This needs to be fixed: https://github.com/zeromq/libzmq/actions/runs/6468544183/job/17560783020?pr=4599
I fixed the clang-format issue but the fuzzers are failing with
clang-15: error: no such file or directory: './external/unity/libunity.a'
Issue
Fixes : https://github.com/zeromq/libzmq/issues/4588
If a zeromq socket attempts connection/reconnection to an ephemeral port on the same host that is not yet active (or recovering from being down), as it cycles through ephemeral ports (for src port) it may attempt reconnection to itself (src/dst ip/port match), the result is a failed connection
protocol_error
and no further connection attempts.A good explanation of "tcp self connection" can be found here: https://totozhang.github.io/2016-01-11-tcp-self-connection/
Fix
When a
protocol_error
occurs, check to see if the src and dst clash. If they do allow the connection to FIN and carry on reconnecting on the next ephemeral port the OS picks.Test
I cant think of a good way to add a automatic test as the issue is very random (OS randomizes port selection for src). To force the test locally I restrict the ephemeral range.
Manual tests
before change
after change