2013-05-10 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Tools.pm: Check that inet_aton does not return undef. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8118 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
2f31062b25
commit
3d656eb704
|
@ -1,3 +1,7 @@
|
|||
2013-05-10 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* lib/PandoraFMS/Tools.pm: Check that inet_aton does not return undef.
|
||||
|
||||
2013-05-07 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* lib/PandoraFMS/Tools.pm: Added a function to resolve hostnames.
|
||||
|
|
|
@ -1171,7 +1171,10 @@ sub cron_get_closest_in_range ($$) {
|
|||
sub resolve_hostname ($) {
|
||||
my ($hostname) = @_;
|
||||
|
||||
return inet_ntoa(inet_aton($hostname));
|
||||
$resolved_hostname = inet_aton($hostname);
|
||||
return $hostname if (! defined ($resolved_hostname));
|
||||
|
||||
return inet_ntoa($resolved_hostname);
|
||||
}
|
||||
|
||||
# End of function declaration
|
||||
|
|
Loading…
Reference in New Issue