safety and tidy the port_macs patch
This commit is contained in:
@@ -29,9 +29,9 @@ addresses supplied as array reference
|
|||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub get_port_macs {
|
sub get_port_macs {
|
||||||
|
|
||||||
my ($fw_mac_list) = @_;
|
my ($fw_mac_list) = @_;
|
||||||
my $port_macs = {};
|
my $port_macs = {};
|
||||||
|
return {} unless defined $fw_mac_list and ref [] eq ref $fw_mac_list;
|
||||||
|
|
||||||
my $dp_macs
|
my $dp_macs
|
||||||
= schema('netdisco')->resultset('DevicePort')
|
= schema('netdisco')->resultset('DevicePort')
|
||||||
|
|||||||
@@ -278,8 +278,7 @@ sub walk_fwtable {
|
|||||||
? {} : $snmp->qb_fw_vlan;
|
? {} : $snmp->qb_fw_vlan;
|
||||||
my $bp_index = $snmp->bp_index;
|
my $bp_index = $snmp->bp_index;
|
||||||
|
|
||||||
my @fw_mac_list = values %$fw_mac;
|
my $port_macs = get_port_macs( values %$fw_mac );
|
||||||
my $port_macs = get_port_macs(\@fw_mac_list);
|
|
||||||
|
|
||||||
# to map forwarding table port to device port we have
|
# to map forwarding table port to device port we have
|
||||||
# fw_port -> bp_index -> interfaces
|
# fw_port -> bp_index -> interfaces
|
||||||
|
|||||||
Reference in New Issue
Block a user