瀏覽代碼

bugfix: exclude 000000000000 as mac from arp record

rajven 5 年之前
父節點
當前提交
1ff1cbdd77
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      scripts/Rstat/snmp.pm

+ 2 - 2
scripts/Rstat/snmp.pm

@@ -127,7 +127,7 @@ sub get_arp_table {
     if ($arp_table1) {
     if ($arp_table1) {
         foreach my $row (keys(%$arp_table1)) {
         foreach my $row (keys(%$arp_table1)) {
         my ($mac_h) = unpack("H*",$arp_table1->{$row});
         my ($mac_h) = unpack("H*",$arp_table1->{$row});
-        next if (!$mac_h);
+        next if (!$mac_h or $mac_h eq '000000000000' or $mac_h eq 'ffffffffffff');
         my $mac;
         my $mac;
         if (length($mac_h)==12) { $mac=lc $mac_h; }
         if (length($mac_h)==12) { $mac=lc $mac_h; }
         next if (!$mac);
         next if (!$mac);
@@ -142,7 +142,7 @@ sub get_arp_table {
     if ($arp_table2) {
     if ($arp_table2) {
         foreach my $row (keys(%$arp_table2)) {
         foreach my $row (keys(%$arp_table2)) {
         my ($mac_h) = unpack("H*",$arp_table2->{$row});
         my ($mac_h) = unpack("H*",$arp_table2->{$row});
-        next if (!$mac_h);
+        next if (!$mac_h or $mac_h eq '000000000000' or $mac_h eq 'ffffffffffff');
         my $mac;
         my $mac;
         if (length($mac_h)==12) { $mac=lc $mac_h; }
         if (length($mac_h)==12) { $mac=lc $mac_h; }
         next if (!$mac);
         next if (!$mac);