From efc60c8825cc8f2e2ed9586e029f4b01305688d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=E1=B4=8F=C9=B4=C9=A2=20Jie?= Date: Tue, 8 Jan 2019 15:54:47 +0800 Subject: [PATCH] Make `makedhcp` working on RHEL 8 xCAT management node (#5930) * Patch dhcp.pm for RHEL 8 * Ignore interface lo while makenetworks * Revise the comments to reflect the code changes --- xCAT-server/lib/xcat/plugins/dhcp.pm | 7 +++++-- xCAT-server/lib/xcat/plugins/networks.pm | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 3e27ead5f..8245b28d1 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -1757,7 +1757,7 @@ sub process_request my $os_ver = $os; $os_ver =~ s/[^0-9.^0-9]//g; if (($os =~ /sles/i && $os_ver >= 11) || - ($os =~ /rhels/i && $os_ver >= 7)) { + ($os =~ /rhels?/i && $os_ver >= 7)) { $dhcpd_key = "DHCPD_INTERFACE"; if ($usingipv6 and $dhcpver eq "dhcpd6") { @@ -1825,7 +1825,10 @@ sub process_request if ($usingipv6) { # sles11.3 and rhels7 has dhcpd and dhcpd6 config in the dhcp file - if ($os =~ /sles/i || $os =~ /rhels7/i) { + my $os_ver = $os; + $os_ver =~ s/[^0-9.^0-9]//g; + if (($os =~ /sles/i && $os_ver >= 11) || + ($os =~ /rhels?/i && $os_ver >= 7)) { if ($missingfiles{dhcpd}) { $callback->({ error => ["The file /etc/sysconfig/dhcpd doesn't exist, check the dhcp server"] }); } diff --git a/xCAT-server/lib/xcat/plugins/networks.pm b/xCAT-server/lib/xcat/plugins/networks.pm index 6484e24ad..5bd4141c8 100644 --- a/xCAT-server/lib/xcat/plugins/networks.pm +++ b/xCAT-server/lib/xcat/plugins/networks.pm @@ -391,9 +391,11 @@ sub donets foreach (@ip6table) { my @ent = split /\s+/, $_; - if ($ent[0] eq 'fe80::/64' or $ent[0] eq 'unreachable' or $ent[1] eq 'via') { + if ($ent[0] eq 'fe80::/64' or $ent[0] eq 'unreachable' or + $ent[1] eq 'via' or $ent[2] eq 'lo') { - #Do not contemplate link-local, unreachable, or gatewayed networks further + #Do not contemplate link-local, unreachable, gatewayed networks, + # or networks connected to loopback interface #DHCPv6 relay will be manually entered into networks as was the case for IPv4 next; }