2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-20 09:22:17 +00:00

fix(ipv6): the Socket6 dependency contradicts the code that loads it

Every caller of Socket6 and IO::Socket::INET6 loads it with an eval and keeps
working on IPv4 when the load fails. NetworkUtils carries a second resolver
path on core Socket for exactly that case. xCAT-server.spec and
xCAT-server/debian/control named both modules as a hard dependency, which
states a dependency the code does not have and stops xCAT installing where
the modules are missing.

Declare both as Recommends in the spec and in debian/control. A package
manager installs a recommendation by default, so a management node still gets
them. Both are in EL AppStream and in openEuler 24.03 everything, measured
from its primary.xml.

The family cache block in networkutils_ipv6_helpers.t was guarded on Socket6
and skipped where the unit suite runs, which has no Socket6. The family cache
keys are the same on both resolver paths, so the guard now accepts either
resolver: six more assertions run, and one of them fails when the OnlyV4 and
OnlyV6 cache split is removed.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
This commit is contained in:
Daniel Hilst
2026-10-22 09:42:43 -03:00
parent 1eb2ac6848
commit ec24b6d23c
4 changed files with 49 additions and 8 deletions
+2 -1
View File
@@ -8,7 +8,8 @@ Homepage: https://xcat.org/
Package: xcat-server
Architecture: all
Depends: ${perl:Depends}, grub-common, libcgi-pm-perl, grub2-xcat (>= 2.02-0.76.el7.1.snap201905160255), perl-xcat (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libsys-syslog-perl, libio-socket-ssl-perl, libxml-simple-perl, make, ucf, libdbd-sqlite3-perl, libexpect-perl, libnet-dns-perl, libsoap-lite-perl, libxml-libxml-perl, libsnmp-perl, debootstrap, libdigest-sha-perl,libcrypt-rijndael-perl,libcrypt-cbc-perl,libjson-perl, libnet-https-nb-perl, libhttp-async-perl, libio-socket-inet6-perl, libsocket6-perl
Depends: ${perl:Depends}, grub-common, libcgi-pm-perl, grub2-xcat (>= 2.02-0.76.el7.1.snap201905160255), perl-xcat (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libsys-syslog-perl, libio-socket-ssl-perl, libxml-simple-perl, make, ucf, libdbd-sqlite3-perl, libexpect-perl, libnet-dns-perl, libsoap-lite-perl, libxml-libxml-perl, libsnmp-perl, debootstrap, libdigest-sha-perl,libcrypt-rijndael-perl,libcrypt-cbc-perl,libjson-perl, libnet-https-nb-perl, libhttp-async-perl
Recommends: libio-socket-inet6-perl, libsocket6-perl
Description: Server and configuration utilities of xCAT
xCAT-server provides the core server and configuration management components
of xCAT.
+11 -6
View File
@@ -88,14 +88,19 @@ Requires: chkconfig
# openssl is present on all EL; require it uniformly (not just el10) so a single
# flat xcat-core build is correct everywhere. Excluded on SLES, where the package
# name differs and it was never required before.
#
# IO::Socket::INET6 and Socket6 carry the AF_INET6 constants the dual-stack
# listener and the discovery callbacks need. They are not in core perl, so a
# management node without them falls back to IPv4 and an IPv6-only node cannot
# reach xcatd.
%if !0%{?suse_version}
Requires: openssl
Requires: perl-IO-Socket-INET6 perl-Socket6
%endif
# IO::Socket::INET6 and Socket6 carry the AF_INET6 constants the discovery
# callbacks use. Every caller loads them with an eval and keeps working on
# IPv4 when they are absent, so a hard Requires would state a dependency the
# code does not have. Recommends installs them by default and still lets xCAT
# install where they are missing.
# Both are in EL AppStream and in openEuler 24.03 everything.
%if !0%{?suse_version}
Recommends: perl-IO-Socket-INET6
Recommends: perl-Socket6
%endif
%if %fsm
+4 -1
View File
@@ -354,7 +354,10 @@ SKIP: {
}
SKIP: {
skip 'Socket6 is required for family-specific resolution', 6 unless $has_socket6;
# The family-specific cache keys are the same on both resolver paths, so
# any IPv6 resolver measures this block. It was guarded on Socket6 and
# skipped where the unit suite runs, which has no Socket6.
skip 'No IPv6 resolver is available', 6 unless $has_core_resolver || $has_socket6;
local %::hostiphash;
is(
@@ -0,0 +1,32 @@
#!/usr/bin/env perl
# Socket6 and IO::Socket::INET6 are loaded with an eval at every call site, and
# the caller keeps working on IPv4 when the load fails. A hard dependency in
# either packaging manifest would state a dependency the code does not have,
# and would stop xCAT installing where the modules are missing.
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../lib";
use Test::More;
use XCAT::Test::File qw(slurp_repo_file);
my $control = slurp_repo_file('xCAT-server/debian/control');
my ($server) = $control =~ /^Package: xcat-server\n(.*?)(?:\n\n|\z)/ms;
$server //= '';
foreach my $package (qw(libsocket6-perl libio-socket-inet6-perl)) {
like( $server, qr/^Recommends:.*\b\Q$package\E\b/m,
"the Debian server package recommends $package" );
unlike( $server, qr/^Depends:.*\b\Q$package\E\b/m,
"the Debian server package does not require $package" );
}
my $spec = slurp_repo_file('xCAT-server/xCAT-server.spec');
foreach my $package (qw(perl-Socket6 perl-IO-Socket-INET6)) {
like( $spec, qr/^Recommends:.*\b\Q$package\E\b/m,
"the RPM server package recommends $package" );
unlike( $spec, qr/^Requires:.*\b\Q$package\E\b/m,
"the RPM server package does not require $package" );
}
done_testing();