test-net-remote-address-port.js sometimes fails with IPv4-mapped addresses #8096
Comments
@misterdjules the original issue (#7637) was that Node was using IPv4 unless it was explicitly told to use IPv6. |
@cjihrig Now that I had more time to think about it, I'm actually concerned about removing the The real issue to me seems to be in SmartOS' implementation of Sorry for the confusion. |
@misterdjules OK. I'll close #8097 for the time being. |
Tests in test-net-remote-address-port.js assume that client and server sockets always use IPv4. However, depending on the OS and the network interfaces setup, this is not true. This change makes the test consider that both IPv4 or IPv6 sockets are valid Fixes nodejs#8096.
@cjihrig When using ADDR_CONFIG, we can't really know what type of IP address we'll get back, so I updated the test such that it doesn't make any assumption about addresses family. |
Tests in test-net-remote-address-port.js assume that client and server sockets always use IPv4. However, depending on the OS and the network interfaces setup, this is not true. This change makes the test consider that both IPv4 or IPv6 sockets are valid Fixes nodejs#8096.
Tests in test-net-remote-address-port.js assume that client and server sockets always use IPv4. However, depending on the OS and the network interfaces setup, this is not true. This change makes the test consider that both IPv4 or IPv6 sockets are valid Fixes nodejs#8096.
Tests in test-net-remote-address-port.js assume that client and server sockets always use IPv4. However, depending on the OS and the network interfaces setup, this is not true. This change makes the test consider that both IPv4 or IPv6 sockets are valid Fixes #8096.
Tests in test-net-remote-address-port.js assume that client and server sockets always use IPv4. However, depending on the OS and the network interfaces setup, this is not true. This change makes the test consider that both IPv4 or IPv6 sockets are valid Fixes #8096.
Tests in test-net-remote-address-port.js assume that client and server sockets always use IPv4. However, depending on the OS and the network interfaces setup, this is not true. This change makes the test consider that both IPv4 or IPv6 sockets are valid Fixes nodejs#8096. Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
Currently,
test-net-remote-address-port.js
fails on our SmartOS jenkins node because the first client TCP connection created with the following code:returns an IPv6 IPv4-mapped address when accessing its
remoteAddress
property.Specifying a host to connect to makes
Socket.prototype.connect
sets theAI_V4MAPPED
flag when callinggetaddrinfo
:cares_wrap::GetAddrinfo
defaults toAF_UNSPEC
when thefamily
is not set:getaddrinfo
's man page on SmartOS seems indicates that:The AI_V4MAPPED flag is ignored unless ai_family equals AF_INET6.
but clearly, it doesn't seem to be the case. Later in the same man page, we can read:
which is slightly confusing.
We can fix this test by passing an
options
object tocreateConnection
with family set to '4'. However, I'm wondering if we actually need to setdns.V4MAPPED
by default when nohost
and nofamily
is supplied, and if so why?Removing dns.V4MAPPED from the
hints
doesn't break any of the current tests (simple and internet)./cc @cjihrig
The text was updated successfully, but these errors were encountered: