diff --git a/ChangeLog b/ChangeLog index 0a02ca5c..71e7d313 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,8 @@ version 3.21 () rather than assuming they are the same. * Capture port VLANs on Cisco interfaces which are configured for trunking but are not in operational trunking mode + * Correct munging of dot1dStpPortDesignatedPort in stp_p_port() and + i_stp_port() methods version 3.20 (2014-09-08) diff --git a/Info.pm b/Info.pm index 5d820392..f199f63e 100644 --- a/Info.pm +++ b/Info.pm @@ -3411,7 +3411,7 @@ sub munge_mac { =item munge_prio_mac() -Takes an 8-byte octet stream (HEX-STRING) and returns a colon separated ASCII +Takes an 2-byte octet stream (HEX-STRING) and returns a colon separated ASCII hex string. =cut @@ -3425,6 +3425,22 @@ sub munge_prio_mac { return; } +=item munge_prio_port() + +Takes an 8-byte octet stream (HEX-STRING) and returns a colon separated ASCII +hex string. + +=cut + +sub munge_prio_port { + my $mac = shift; + return unless defined $mac; + return unless length $mac; + $mac = join( ':', map { sprintf "%02x", $_ } unpack( 'C*', $mac ) ); + return $mac if $mac =~ /^([0-9A-F][0-9A-F]:){1}[0-9A-F][0-9A-F]$/i; + return; +} + =item munge_octet2hex() Takes a binary octet stream and returns an ASCII hex string diff --git a/Info/Bridge.pm b/Info/Bridge.pm index ba654e0d..d3f3d5cd 100644 --- a/Info/Bridge.pm +++ b/Info/Bridge.pm @@ -128,7 +128,7 @@ $VERSION = '3.20'; 'stp_root' => \&SNMP::Info::munge_mac, 'stp_p_root' => \&SNMP::Info::munge_prio_mac, 'stp_p_bridge' => \&SNMP::Info::munge_prio_mac, - 'stp_p_port' => \&SNMP::Info::munge_prio_mac, + 'stp_p_port' => \&SNMP::Info::munge_prio_port, 'qb_cv_egress' => \&SNMP::Info::munge_port_list, 'qb_cv_untagged' => \&SNMP::Info::munge_port_list, 'qb_v_egress' => \&SNMP::Info::munge_port_list,