From: janw Date: Wed, 27 Feb 2008 10:31:22 +0000 (+0000) Subject: Remove Net::DNS in favor of socket. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=296e7ed5f57aea69510eb4fdccca3297c71f865c;p=gosa.git Remove Net::DNS in favor of socket. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9160 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/modules/ArpHandler.pm b/gosa-si/modules/ArpHandler.pm index d81ef57d5..fec419de2 100644 --- a/gosa-si/modules/ArpHandler.pm +++ b/gosa-si/modules/ArpHandler.pm @@ -14,6 +14,7 @@ use Net::LDAP::Entry; use Net::DNS; use Switch; use Data::Dumper; +use Socket; use utf8; # Don't start if some of the modules are missing @@ -36,7 +37,6 @@ END{} 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 = @@ -179,8 +179,7 @@ sub got_packet { 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;