]> mj.ucw.cz Git - jablonka.git/commitdiff
show-switch: work-around for broken hispeed master
authorMartin Mares <mj@ucw.cz>
Sun, 28 Jan 2018 23:15:13 +0000 (00:15 +0100)
committerMartin Mares <mj@ucw.cz>
Sun, 28 Jan 2018 23:15:13 +0000 (00:15 +0100)
show-switch

index 733f93b9ffd8d2e4b0f788fbba63af49dacee8b8..9dab19c7317dc074e0c2db19c9adf85d630a7b80 100755 (executable)
@@ -123,6 +123,10 @@ my %if_macs = ();
 for my $if (values %$if_table) {
        $if->{mac} = join(':', map { sprintf "%02x", ord $_ } split(//, $if->{mac}));
        $if_macs{$if->{mac}} = 1;
+       if ($if->{hispeed} == $if->{speed}) {
+               # Some buggy switches put hispeed == speed
+               delete $if->{hispeed};
+       }
 }
 print "# Interface table:\n", Dumper($if_table) if $debug;
 my @ifaces = sort { $a <=> $b } keys %$if_table;