mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-11-21 09:52:17 +00:00
8f95556ed5
xcatd asks gethostbyaddr for AF_INET6 and retries with AF_INET when the first lookup answers nothing. Both calls pass $conn->peeraddr. On a dual-stack listener that is the 16-byte ::ffff:a.b.c.d for an IPv4 peer, and AF_INET needs 4 bytes, so the retry is unreachable code. The install monitor then discards the node's status update and no node reaches the booted state. xCAT::NetworkUtils::unmap_v4mapped_addr returns the 4 IPv4 bytes of a mapped address and returns anything else unchanged, so a real IPv6 address keeps all 16 bytes. The install monitor and the SSL listener pass the peer address through it before the AF_INET retry. networkutils_unmap_v4mapped.t covers both directions. Removing the mapped branch fails only the mapped assertion; returning substr for every 16-byte address fails only the two IPv6 assertions. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>