Override layers in Juniper for routers with switch modules not reporting L2 capability
This commit is contained in:
@@ -89,6 +89,20 @@ sub os {
|
||||
return 'junos';
|
||||
}
|
||||
|
||||
sub layers {
|
||||
my $juniper = shift;
|
||||
|
||||
my $layers = $juniper->SUPER::layers();
|
||||
# Some models don't report L2 properly
|
||||
my $macs = $juniper->fw_mac();
|
||||
|
||||
if (keys %$macs) {
|
||||
my $l = substr $layers, 6, 1, "1";
|
||||
}
|
||||
|
||||
return $layers;
|
||||
}
|
||||
|
||||
sub os_ver {
|
||||
my $juniper = shift;
|
||||
|
||||
@@ -590,6 +604,11 @@ Returns 'juniper'
|
||||
|
||||
Returns 'junos'
|
||||
|
||||
=item $juniper->layers()
|
||||
|
||||
Checks forwarding table for Layer 2 support since some routers with switches
|
||||
do not report layers properly.
|
||||
|
||||
=item $juniper->os_ver()
|
||||
|
||||
Returns the software version extracted first from C<sysDescr> or
|
||||
|
||||
Reference in New Issue
Block a user