From: janw Date: Tue, 24 Aug 2010 13:19:37 +0000 (+0000) Subject: Use client_ip if set. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e1cae1b27996ecb6d8ae6bc02109ccd3572d57c0;p=gosa.git Use client_ip if set. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19435 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client index 56200d996..003d30f72 100755 --- a/gosa-si/gosa-si-client +++ b/gosa-si/gosa-si-client @@ -676,7 +676,7 @@ sub register_at_gosa_si_server { } # Check if our ip is resolvable - if not: don't try to register - my $ip= &get_local_ip_for_remote_ip(sprintf("%s", $server =~ /^([0-9\.]*?):.*$/)); + my $ip= defined($client_ip)?$client_ip:&get_local_ip_for_remote_ip(sprintf("%s", $server =~ /^([0-9\.]*?):.*$/)); my $dnsname= gethostbyaddr(inet_aton($ip), AF_INET); if(!defined($dnsname)) { if( defined($client_force_hostname) && $client_force_hostname eq "true") { @@ -689,7 +689,7 @@ sub register_at_gosa_si_server { } # create registration msg - my $local_ip = &get_local_ip_for_remote_ip(sprintf("%s", $server =~ /^([0-9\.]*?):.*$/)); + my $local_ip = (defined($client_ip))?$client_ip:&get_local_ip_for_remote_ip(sprintf("%s", $server =~ /^([0-9\.]*?):.*$/)); my $local_mac = &get_local_mac_for_remote_ip(sprintf("%s", $server =~ /^([0-9\.]*?):.*$/)); my $register_hash = &create_xml_hash("here_i_am", $local_ip.":".$client_port, $server); &add_content2xml_hash($register_hash, "new_passwd", $server_key); @@ -718,7 +718,7 @@ sub register_at_gosa_si_server { $try_to_register = 0; # Set fixed client address and mac address - $client_ip= &get_local_ip_for_remote_ip(sprintf("%s", $server =~ /^([0-9\.]*?):.*$/)); + $client_ip= (defined($client_ip))?$client_ip:&get_local_ip_for_remote_ip(sprintf("%s", $server =~ /^([0-9\.]*?):.*$/)); $client_address= "$client_ip:$client_port"; $client_mac_address = $local_mac; $client_dnsname = $dnsname;