From 9c58ca3672d6a12357e592939fa432414529a3c4 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Wed, 16 Jun 2010 19:19:47 +0000 Subject: [PATCH] -Place dynamic range tracking into a place that will actually run git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6491 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/dhcp.pm | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 12c3908c6..beb885a56 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -714,7 +714,15 @@ sub process_request } } my $nettab = xCAT::Table->new("networks"); - my @vnets = $nettab->getAllAttribs('net','mgtifname','mask'); + my @vnets = $nettab->getAllAttribs('net','mgtifname','mask','dynamicrange'); + foreach (@vnets) { + my $trange = $_->{dynamicrange}; #temp range, the dollar sign makes it look strange + $trange =~ s/[,-]/ /g; + my $begin; + my $end; + ($begin,$end) = split / /,$trange; + $dynamicranges{$trange}=[unpack("N*",inet_aton($begin)),unpack("N*",inet_aton($end))]; + } if ($^O eq 'aix') { @nrn = xCAT::Utils::get_subnet_aix(); @@ -1160,16 +1168,11 @@ sub addnet } if ($ent and $ent->{dynamicrange}) { - my $trange = $ent->{dynamicrange}; #temp range, the dollar sign makes it look strange - $trange =~ s/[,-]/ /g; - my $begin; - my $end; - ($begin,$end) = split / /,$trange; - $dynamicranges{$trange}=[unpack("N*",inet_aton($begin)),unpack("N*",inet_aton($end))]; unless ($ent->{dhcpserver} and xCAT::Utils->thishostisnot($ent->{dhcpserver})) { #If specific, only one dhcp server gets a dynamic range - $range = $trange; + $range = $ent->{dynamicrange}; + $range =~ s/[,-]/ /g; } } else