From cac2677c1cfe4c3936a037c1a36994043153ae56 Mon Sep 17 00:00:00 2001 From: ligc Date: Tue, 29 Oct 2013 10:48:31 +0800 Subject: [PATCH] temp fix for bug 3792: multiple nics in the same subnet, use the first nic that in the subnet for dhcp --- xCAT-server/lib/xcat/plugins/dhcp.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) mode change 100644 => 100755 xCAT-server/lib/xcat/plugins/dhcp.pm diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm old mode 100644 new mode 100755 index 46963a50e..90f3b55db --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -1998,6 +1998,11 @@ sub addnet if ($ent[0] eq $net and $ent[2] eq $mask) { $nic = $ent[1]; + # The first nic that matches the network, + # what will happen if there are more than one nics in the same subnet, + # and we want to use the second nic as the dhcp interfaces? + # this is a TODO + last; } } #print " add $net $mask under $nic\n"; @@ -2014,6 +2019,13 @@ sub addnet } unless ($dhcpconf[$idx] =~ /\} # $nic nic_end\n/) { + $callback->( + { + error => + ["Could not add the subnet $net/$mask for nic $nic into $dhcpconffile."], + errorcode => [1] + } + ); return 1; #TODO: this is an error condition } }