Code

gotoHardwareChecksum gets added to LDAP if not present
[gosa.git] / gosa-si / modules / ArpHandler.pm
index 15297a1f612e8c9088b62fe64b9515d3298e8f97..bb2809fdb9e954beaf3c5eeff3be70a327cb01f2 100644 (file)
@@ -188,13 +188,14 @@ sub got_packet {
                my $ldap_result=&get_host_from_ldap($packet->{source_haddr});
                if(exists($ldap_result->{dn})) {
                        $hosts_database->{$packet->{source_haddr}}=$ldap_result;
+                       $hosts_database->{$packet->{source_haddr}}->{dnsname}= $dnsname;
                        if(!exists($ldap_result->{ipHostNumber})) {
                                $hosts_database->{$packet->{source_haddr}}->{ipHostNumber}=$packet->{source_ipaddr};
                        } else {
                                if(!($ldap_result->{ipHostNumber} eq $packet->{source_ipaddr})) {
                                        &main::daemon_log(
                                                "Current IP Address ".$packet->{source_ipaddr}.
-                                               " of host ".$ldap_result->{dnsname}.
+                                               " of host ".$hosts_database->{$packet->{source_haddr}}->{dnsname}.
                                                " differs from LDAP (".$ldap_result->{ipHostNumber}.")", 4);
                                }
                        }
@@ -436,7 +437,7 @@ sub change_ldap_entry {
                'gotoSysStatus' => $gotoSysStatus,
        };
        if (defined($ip)) {
-               $replace->{'ip'} = $ip;
+               $replace->{'ipHostNumber'} = $ip;
        }
     my $result = $ldap->modify( $dn, replace => $replace );