From f60a97dcb2a422e3b9994f5aaf16b597bdcfdb0e Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 26 Jul 2018 16:03:47 -0400 Subject: [PATCH 1/3] Have dhcp.pm recognize OPA hwaddr --- xCAT-server/lib/xcat/plugins/dhcp.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 3e27ead5f..8bd8121bb 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -764,6 +764,8 @@ sub addnode $hostname = $1 . "-hf" . $count; } } + } elsif (length($mac) == 23) { + $hardwaretype = 32; } #syslog("local4|err", "Setting $node ($hname|$ip) to " . $mac); From 1a4b89523bfb6b288f542cd9a157f211d6af122e Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 24 Jan 2019 13:44:15 -0500 Subject: [PATCH 2/3] Allow IB/OPA addresses in mac table again The change blocked valid addresses. --- xCAT-server/lib/xcat/plugins/dhcp.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 8bd8121bb..35424a5d5 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -610,7 +610,7 @@ sub addnode $hname = $node; } #Default to hostname equal to nodename unless ($mac) { next; } #Skip corrupt format - if ($mac !~ /^[0-9a-fA-F]{2}(-[0-9a-fA-F]{2}){5}$|^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}$/) + if ($mac !~ /^[0-9a-fA-F]{2}(-[0-9a-fA-F]{2}){5,7}$|^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5,7}$/) { $callback->( { From 6df30438b2f5bf8e619d80e9297721f79389964b Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 25 Jan 2019 10:43:20 -0500 Subject: [PATCH 3/3] Add comments to explain the hwtype change --- xCAT-server/lib/xcat/plugins/dhcp.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 35424a5d5..a26c6e492 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -764,7 +764,9 @@ sub addnode $hostname = $1 . "-hf" . $count; } } - } elsif (length($mac) == 23) { + } elsif (length($mac) == 23) { # 8 bytes of mac address + # Currently the only thing that has 8 bytes is an infiniband + # or infiniband like device, which is type 32 (0x20). $hardwaretype = 32; }