diff --git a/ChangeLog b/ChangeLog index e5a0209b..22c74c7f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,9 @@ version 3.11 * Modify cdp_cap() to handle devices which return space delimited strings for cdpCacheCapabilities rather than hex strings + * [#51] Netdisco shows broken topology for devices with no alias entry + for primary IP - Collect nsIfMngIp when getting IP interfaces in + L3::Netscreen version 3.10 (2013-12-16) diff --git a/Info/Layer3/Netscreen.pm b/Info/Layer3/Netscreen.pm index de54c2b9..f7e3a268 100644 --- a/Info/Layer3/Netscreen.pm +++ b/Info/Layer3/Netscreen.pm @@ -345,30 +345,47 @@ sub _mac_map { return \%mac_map; } +# Interfaces can have two addresses, we want to capture both the network +# address and the management address sub ip_index { my $netscreen = shift; - my $ns_ip = $netscreen->ns_ip_table() || {}; + my $ns_ip = $netscreen->ns_ip_table() || {}; + my $if_mng_ip = $netscreen->nsIfMngIp() || {}; my %ip_index = (); foreach my $iid ( keys %$ns_ip ) { $ip_index{ $ns_ip->{$iid} } = $iid if $ns_ip->{$iid} ne "0.0.0.0"; } + foreach my $iid ( keys %$if_mng_ip ) { + $ip_index{ $if_mng_ip->{$iid} } = $iid + if $if_mng_ip->{$iid} ne "0.0.0.0"; + } return \%ip_index; } sub ip_table { my $netscreen = shift; - my $ip_index = $netscreen->ip_index() || {}; + my $ip_index = $netscreen->ip_index() || {}; + my $if_mng_ip = $netscreen->nsIfMngIp() || {}; my %ip_table = (); foreach my $iid ( keys %$ip_index ) { - $ip_table{$iid} = $iid; + my $mgmt_ip = $if_mng_ip->{$iid}; + + if ( defined $mgmt_ip && $mgmt_ip ne '0.0.0.0' ) { + $ip_table{$iid} = $mgmt_ip; + } + else { + $ip_table{$iid} = $iid; + } } return \%ip_table; } +# There is only one netmask for the interface both network and management +# addresses should have the same netmask sub ip_netmask { my $netscreen = shift;