2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 17:23:08 +00:00

switch_macmap output showed mac address on the wrong port for cumulus (#4225)

switch
This commit is contained in:
cxhong 2017-11-01 22:46:04 -04:00 committed by yangsong
parent 4d06dc05e8
commit 01bf03de74

View File

@ -760,6 +760,7 @@ sub refresh_switch {
printf $output "$mymac|%s\n", $self->{switches}->{$switch}->{$myport};
}
}
$macport="swp".$macport;
push @{ $index_to_vlan{$macport} }, $macvlan;
push @{ $index_to_mac{$macport} }, $mymac;
}
@ -840,15 +841,15 @@ sub refresh_switch {
my $port_index = $boid;
my $port_name = $namemap->{ $bridgetoifmap->{$port_index} };
my $mtu = $iftomtumap->{ $bridgetoifmap->{$port_index} };
if (defined($index_to_mac{$port_index})) {
push @{ $self->{macinfo}->{$switch}->{$port_name} }, @{ $index_to_mac{$port_index} };
if (defined($index_to_mac{$port_name})) {
push @{ $self->{macinfo}->{$switch}->{$port_name} }, @{ $index_to_mac{$port_name} };
}
else {
$self->{macinfo}->{$switch}->{$port_name}->[0] = '';
}
if (defined($index_to_vlan{$port_index})) {
push @{ $self->{vlaninfo}->{$switch}->{$port_name} }, @{ $index_to_vlan{$port_index} };
if (defined($index_to_vlan{$port_name})) {
push @{ $self->{vlaninfo}->{$switch}->{$port_name} }, @{ $index_to_vlan{$port_name} };
}
else {
$self->{vlaninfo}->{$switch}->{$port_name}->[0] = '';