Code

Use client_ip if set.
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 24 Aug 2010 13:19:37 +0000 (13:19 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 24 Aug 2010 13:19:37 +0000 (13:19 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19435 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/gosa-si-client

index 56200d9964557078bc8530c094f7acf8de4b250f..003d30f72e8df25d504a25bae93fb516b4348e46 100755 (executable)
@@ -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;