From a3e16d83f96224b62e41b141da68c960b0946556 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Thu, 3 Sep 2026 17:17:04 -0300 Subject: [PATCH] fix(networkutils): OnlyV4 is answered from the cache whatever family it holds getipaddr returns a cached address before it resolves, and the bypass tests OnlyV6 and GetAllAddresses only. A caller asking OnlyV4 therefore receives whatever the first lookup stored. An unrestricted lookup asks for AF_UNSPEC, so on a dual-stack management node it stores the AAAA record, and %::hostiphash is a global in a long-lived xcatd. debian.pm resolves the install server with OnlyV4 and writes nfsroot=
:/install. Given the cached IPv6 that renders nfsroot=2001:db8::1:/install, which does not parse, so the Subiquity installer never mounts and the node never completes. dhcp.pm and mknb.pm hold four more OnlyV4 callers with the same exposure. Skip the cache when OnlyV4 is asked for and the cached address is IPv6. The lookup that follows requests AF_INET and replaces the entry with the IPv4 address, so the next caller of either kind gets a usable one. An IPv4 entry is still served from the cache: the bypass is about the family of the cached answer, not about disabling the cache for OnlyV4. networkutils_getipaddr_onlyv4.t fails without this change. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- perl-xCAT/xCAT/NetworkUtils.pm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/NetworkUtils.pm b/perl-xCAT/xCAT/NetworkUtils.pm index 02b0fe8ea..92e16631e 100644 --- a/perl-xCAT/xCAT/NetworkUtils.pm +++ b/perl-xCAT/xCAT/NetworkUtils.pm @@ -288,8 +288,20 @@ sub getipaddr #print "============================\n"; #cache, do not lookup DNS each time + # + # An unrestricted lookup asks for AF_UNSPEC and caches whatever came back, which + # on a dual-stack host is the AAAA record. Serving that to an OnlyV4 caller gives + # it an IPv6 address it cannot use: debian.pm renders nfsroot=: