From 7ae7997eb3e2f3dd13ca89e56dde013d8060e922 Mon Sep 17 00:00:00 2001 From: janw Date: Fri, 30 Oct 2009 12:45:25 +0000 Subject: [PATCH] Don't bail out if getting a hostname, convert it to an ip instead. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14716 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/modules/GosaSupportDaemon.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gosa-si/modules/GosaSupportDaemon.pm b/gosa-si/modules/GosaSupportDaemon.pm index d6420a142..3cc769ba8 100644 --- a/gosa-si/modules/GosaSupportDaemon.pm +++ b/gosa-si/modules/GosaSupportDaemon.pm @@ -684,6 +684,15 @@ sub get_ip { sub get_interface_for_ip { my $result; my $ip= shift; + + if($ip =~ /^[a-z]/i) { + my $ip_address = inet_ntoa(scalar gethostbyname($ip)); + if(defined($ip_address) && $ip_address =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/) { + # Write ip address to $source variable + $ip = $ip_address; + } + } + if ($ip && length($ip) > 0) { my @ifs= &get_interfaces(); if($ip eq "0.0.0.0") { -- 2.30.2