From 2f6f0293827d9eeda77e19fa9fbedecd29d7b419 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Thu, 29 Oct 2026 13:49:07 -0300 Subject: [PATCH] fix(xcat-core): a diskless node has no server in its imgurl mknetboot in debian.pm builds the imgurl from the image server, which is the '!myipfn!' placeholder whenever noderes.tftpserver and noderes.xcatmaster are unset. Commit 7ab362835 wrapped that value in format_host_port so an IPv6 server would be bracketed. format_host_port refuses the placeholder, because format_uri_host validates it as a host name, so the imgurl lost its server and its port and read "imgurl=http:////install/netboot/.../rootimg.cpio.gz". The node then had no address to fetch its root image from. This reached every Ubuntu diskless node, not only an IPv6 one: upstream interpolated the value directly and the placeholder survived to be substituted. format_uri_host now returns the placeholder unchanged, the way uri_authority already passes it through for the XCAT= parameter. The boot loader plugins substitute it afterwards, and substitute_facing_address brackets it when the facing address is IPv6. Measured on an IPv6-only Ubuntu 24.04 node: the grub2 command line now carries imgurl=http://[2001:db8:147::1]:80/install/... beside ip=either6. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- perl-xCAT/xCAT/NetworkUtils.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/perl-xCAT/xCAT/NetworkUtils.pm b/perl-xCAT/xCAT/NetworkUtils.pm index f5ef9c9c7f..5030c2a590 100644 --- a/perl-xCAT/xCAT/NetworkUtils.pm +++ b/perl-xCAT/xCAT/NetworkUtils.pm @@ -3020,6 +3020,12 @@ sub format_uri_host } return unless defined($host) && length($host); + + # '!myipfn!' is the facing-address placeholder, not a host. pxe.pm, grub2.pm and + # petitboot.pm replace it after the command line is built, and + # substitute_facing_address brackets it there when the address is IPv6. + return $host if $host eq '!myipfn!'; + if ($host =~ /^\[([^\]]+)\]$/) { my $address = $1;