Correct munging of dot1dStpPortDesignatedPort in stp_p_port() and i_stp_port() methods

This commit is contained in:
Eric A. Miller
2014-11-09 17:43:41 -05:00
parent 09e18e9b64
commit 47954aba8e
3 changed files with 20 additions and 2 deletions

18
Info.pm
View File

@@ -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