summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 934aef2)
raw | patch | inline | side by side (parent: 934aef2)
author | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 27 Feb 2008 10:31:22 +0000 (10:31 +0000) | ||
committer | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 27 Feb 2008 10:31:22 +0000 (10:31 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9160 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/modules/ArpHandler.pm | patch | blob | history |
index d81ef57d5a6db68d02f95300da152236053c6ec7..fec419de2e9cb68520eaa87c6576b3703ca87dde 100644 (file)
use Net::DNS;
use Switch;
use Data::Dumper;
+use Socket;
use utf8;
# Don't start if some of the modules are missing
my ($timeout, $mailto, $mailfrom, $user, $group);
my ($arp_enabled, $arp_interface, $ldap_uri, $ldap_base, $ldap_admin_dn, $ldap_admin_password);
my $hosts_database={};
-my $resolver=Net::DNS::Resolver->new;
my $ldap;
my %cfg_defaults =
my $capture_device = sprintf "%s", $kernel->alias_list($sender) =~ /^arp_watch_(.*)$/;
if(!exists($hosts_database->{$packet->{source_haddr}})) {
- my $dnsresult= $resolver->search($packet->{source_ipaddr});
- my $dnsname= (defined($dnsresult))?$dnsresult->{answer}[0]->{ptrdname}:$packet->{source_ipaddr};
+ my $dnsname= gethostbyaddr(inet_aton($packet->{source_ipaddr}), AF_INET) || $packet->{source_ipaddr};
my $ldap_result=&get_host_from_ldap($packet->{source_haddr});
if(exists($ldap_result->{dn})) {
$hosts_database->{$packet->{source_haddr}}=$ldap_result;