Skip to content

Conversation

@hericah
Copy link

@hericah hericah commented May 28, 2025

When getaddrinfo also return IPv6 then program getting OSError: 124. This patch to ensure getaddrinfo only return IPv4 with TCP protocol.

Before:
[(10, 2, 6, 'echo.websocket.org', bytearray(b'\n\x00\x01\xbb\x00\x00\x00\x00*\t\x82\x80\x00\x01\x00\x00\x00\x00\x00\x00\x007\xb5\xc3\x00\x00\x00\x00')), (10, 1, 17, 'echo.websocket.org', bytearray(b'\n\x00\x01\xbb\x00\x00\x00\x00*\t\x82\x80\x00\x01\x00\x00\x00\x00\x00\x00\x007\xb5\xc3\x00\x00\x00\x00')), (2, 2, 6, 'echo.websocket.org', bytearray(b'\x02\x00\x01\xbbB\xf1|w\x00\x00\x00\x00\x00\x00\x00\x00')), (2, 1, 17, 'echo.websocket.org', bytearray(b'\x02\x00\x01\xbbB\xf1|w\x00\x00\x00\x00\x00\x00\x00\x00'))]

after:
[(2, 2, 6, 'echo.websocket.org', bytearray(b'\x02\x00\x01\xbbB\xf1|w\x00\x00\x00\x00\x00\x00\x00\x00'))]

When getaddrinfo also return IPv6 then program getting OSError: 124. This patch to ensure getaddrinfo only return IPv4 with TCP protocol.

Before:
[(10, 2, 6, 'echo.websocket.org', bytearray(b'\n\x00\x01\xbb\x00\x00\x00\x00*\t\x82\x80\x00\x01\x00\x00\x00\x00\x00\x00\x007\xb5\xc3\x00\x00\x00\x00')), (10, 1, 17, 'echo.websocket.org', bytearray(b'\n\x00\x01\xbb\x00\x00\x00\x00*\t\x82\x80\x00\x01\x00\x00\x00\x00\x00\x00\x007\xb5\xc3\x00\x00\x00\x00')), (2, 2, 6, 'echo.websocket.org', bytearray(b'\x02\x00\x01\xbbB\xf1|w\x00\x00\x00\x00\x00\x00\x00\x00')), (2, 1, 17, 'echo.websocket.org', bytearray(b'\x02\x00\x01\xbbB\xf1|w\x00\x00\x00\x00\x00\x00\x00\x00'))]

after:
[(2, 2, 6, 'echo.websocket.org', bytearray(b'\x02\x00\x01\xbbB\xf1|w\x00\x00\x00\x00\x00\x00\x00\x00'))]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant