From 1ca5cc895c1a78173839776ce575beb3c38ad829 Mon Sep 17 00:00:00 2001 From: janw Date: Fri, 13 Mar 2009 08:58:23 +0000 Subject: [PATCH] Try to translate hostname to ip. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13541 594d385d-05f5-0310-b6e9-bd551577e9d8 --- trunk/gosa-si/gosa-si-client | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/trunk/gosa-si/gosa-si-client b/trunk/gosa-si/gosa-si-client index 8142b35a0..4d109684f 100755 --- a/trunk/gosa-si/gosa-si-client +++ b/trunk/gosa-si/gosa-si-client @@ -329,6 +329,14 @@ sub get_local_mac_for_remote_ip { my $server_ip= shift; my $result= "00:00:00:00:00:00"; + if($server_ip =~ /^[a-z][a-z0-9\.]$/i) { + my $ip_address = inet_ntoa(scalar gethostbyname($server_ip)); + if(defined($ip_address) && $ip_address =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/ && $port =~ /^\d+$/) { + # Write ip address to $server_ip variable + $server_ip = $ip_address; + } + } + if($server_ip =~ /^(\d\d?\d?\.){3}\d\d?\d?$/) { my $PROC_NET_ROUTE= ('/proc/net/route'); -- 2.30.2