fix for mac() when topology off

This commit is contained in:
Eric Miller
2005-06-03 03:02:36 +00:00
parent 089430de17
commit d8e1e932ae

View File

@@ -223,7 +223,7 @@ sub c_port {
else { else {
# Segment id is (256 * remote slot_num) + (remote_port) # Segment id is (256 * remote slot_num) + (remote_port)
my $remote_port = $seg % 256; my $remote_port = $seg % 256;
my $remote_slot = int($seg / 256); my $remote_slot = int($seg / 256);
$c_port{"$index.1"} = "$remote_slot.$remote_port"; $c_port{"$index.1"} = "$remote_slot.$remote_port";
} }
@@ -282,8 +282,10 @@ sub mac {
my $port = $sonmp_topo_port->{$entry}; my $port = $sonmp_topo_port->{$entry};
next unless $port == 0; next unless $port == 0;
my $mac = $sonmp_topo_mac->{$entry}; my $mac = $sonmp_topo_mac->{$entry};
return $mac; return $mac;
} }
# Topology turned off, not supported.
return undef;
} }
1; 1;