added check for root_ip() addresses of all zeros

This commit is contained in:
Max Baker
2004-06-19 23:21:01 +00:00
parent 598c075670
commit 96393d5781

View File

@@ -115,12 +115,13 @@ sub root_ip {
if (defined $ospf_ip and scalar(keys %$ospf_ip)){ if (defined $ospf_ip and scalar(keys %$ospf_ip)){
foreach my $key (keys %$ospf_ip){ foreach my $key (keys %$ospf_ip){
my $ip = $ospf_ip->{$key}; my $ip = $ospf_ip->{$key};
next if $ip eq '0.0.0.0';
print " SNMP::Layer3::root_ip() using $ip\n" if $DEBUG; print " SNMP::Layer3::root_ip() using $ip\n" if $DEBUG;
return $ip; return $ip;
} }
} }
return $router_ip if defined $router_ip; return $router_ip if (defined $router_ip and $router_ip ne '0.0.0.0');
return undef; return undef;
} }