From 4b59e1cdc1d32cb5846c829659ded822f6149ea3 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Wed, 20 May 2015 04:54:36 -0400 Subject: [PATCH] rspconfig ip=dhcp to set BMC get ip address through DHCP --- xCAT-server/lib/xcat/plugins/ipmi.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 13274202e..caa6c36aa 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -892,6 +892,8 @@ sub setnetinfo { $mask[$_] = $mask[$_] + 0; } @cmd = (0x01,$channel_number,12,@mask); + } elsif ($subcommand =~ m/ip/ and $argument =~ m/dhcp/) { + @cmd = (0x01,$channel_number,0x4,0x2); } elsif ($subcommand =~ m/ip/) { my $mip = inet_ntoa(inet_aton($argument)); my @mask = split /\./, $mip; @@ -946,6 +948,12 @@ sub netinfo_set { } return; } + if ($sessdata->{subcommand} =~ m/^ip=dhcp/) { + $sessdata->{subcommand} = shift @{$sessdata->{extraargs}}; + if (!defined($sessdata->{subcommand}) or $sessdata->{subcommand} eq '') { + return; + } + } getnetinfo($sessdata); return; }