2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-06-20 10:30:48 +00:00

Merge pull request #7539 from VersatusHPC/fix/ipmi-vlan-disable

fix: IPMI VLAN disable
This commit is contained in:
Markus Hilger
2026-05-03 20:10:47 +02:00
committed by GitHub
3 changed files with 19 additions and 15 deletions
@@ -471,7 +471,7 @@ OPTIONS
\ **vlan**\
Get or set vlan ID. For get vlan ID, if vlan is not enabled, 'BMC VLAN disabled' will be displayed. For set vlan ID, the valid value are [1-4096].
Get or set VLAN ID. Valid VLAN IDs are 1-4094. On IPMI managed nodes, use \ **vlan=off**\ or \ **vlan=disable**\ to disable VLAN tagging.
+1 -1
View File
@@ -372,7 +372,7 @@ Get or set hostname on the service processor.
=item B<vlan>
Get or set vlan ID. For get vlan ID, if vlan is not enabled, 'BMC VLAN disabled' will be displayed. For set vlan ID, the valid value are [1-4096].
Get or set VLAN ID. Valid VLAN IDs are 1-4094. On IPMI managed nodes, use B<vlan=off> or B<vlan=disable> to disable VLAN tagging.
=item B<ipsrc>
+17 -13
View File
@@ -895,10 +895,10 @@ sub setnetinfo {
if ($subcommand eq "thermprofile") {
return idpxthermprofile($argument);
}
if ($subcommand eq "alert" and $argument eq "on" or $argument =~ /^en/ or $argument =~ /^enable/) {
if ($subcommand eq "alert" and ($argument =~ /^(on|en|enable|enabled)$/i)) {
$netfun = 0x4;
@cmd = (0x12, 0x9, 0x1, 0x18, 0x11, 0x00);
} elsif ($subcommand eq "alert" and $argument eq "off" or $argument =~ /^dis/ or $argument =~ /^disable/) {
} elsif ($subcommand eq "alert" and ($argument =~ /^(off|dis|disable|disabled)$/i)) {
$netfun = 0x4;
@cmd = (0x12, 0x9, 0x1, 0x10, 0x11, 0x00);
}
@@ -946,18 +946,22 @@ sub setnetinfo {
}
@cmd = (0x01, $channel_number, 12, @mask);
} elsif ($subcommand =~ m/vlan/) {
unless ( int($argument) == $argument ) {
$callback->({ errorcode => [1], error => ["The input $argument is invalid, please input an integer"] });
return;
if ($argument =~ /^(off|disable|disabled)$/i) {
@cmd = (0x01, $channel_number, 0x14, 0x00, 0x00);
} else {
unless ( $argument =~ /^\d+$/ ) {
$callback->({ errorcode => [1], error => ["The input $argument is invalid, please input an integer or 'off'"] });
return;
}
unless (($argument>=1) && ($argument<=4094)) {
$callback->({ errorcode => [1], error => ["The input $argument is invalid, valid value [1-4094] or 'off'"] });
return;
}
my @vlanparam = ();
$vlanparam[0] = ($argument & 0xff);
$vlanparam[1] = 0x80 | (($argument & 0xf00) >> 8);
@cmd = (0x01, $channel_number, 0x14, @vlanparam);
}
unless (($argument>=1) && ($argument<=4096)) {
$callback->({ errorcode => [1], error => ["The input $argument is invalid, valid value [1-4096]"] });
return;
}
my @vlanparam = ();
$vlanparam[0] = ($argument & 0xff);
$vlanparam[1] = 0x80 | (($argument & 0xf00) >> 8);
@cmd = (0x01, $channel_number, 0x14, @vlanparam);
} elsif ($subcommand =~ m/ip/ and $argument =~ m/dhcp/) {
@cmd = (0x01, $channel_number, 0x4, 0x2);
} elsif ($subcommand =~ m/ip/) {