2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-09-16 15:18:34 +00:00

rspconfig ip=dhcp to set BMC get ip address through DHCP

This commit is contained in:
ertaozh
2015-05-20 04:54:36 -04:00
parent 292fd7abfd
commit 4b59e1cdc1

View File

@@ -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;
}