From: janw Date: Mon, 18 May 2009 08:11:29 +0000 (+0000) Subject: New config option in ArpHandler to control if existing entries should be updated... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5a452dda4cef0f5035fb1e9e77f83bee12024973;p=gosa.git New config option in ArpHandler to control if existing entries should be updated or not. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13652 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/modules/ArpHandler.pm b/gosa-si/modules/ArpHandler.pm index 7780d2adc..144d72b55 100644 --- a/gosa-si/modules/ArpHandler.pm +++ b/gosa-si/modules/ArpHandler.pm @@ -34,7 +34,7 @@ BEGIN{ END{} my ($timeout, $mailto, $mailfrom, $user, $group); -my ($arp_enabled, $arp_interface, $ldap_uri, $ldap_base, $ldap_admin_dn, $ldap_admin_password); +my ($arp_enabled, $arp_interface, $arp_update, $ldap_uri, $ldap_base, $ldap_admin_dn, $ldap_admin_password); my $hosts_database={}; my $ldap; @@ -43,6 +43,7 @@ my %cfg_defaults = "ArpHandler" => { "enabled" => [\$arp_enabled, "true"], "interface" => [\$arp_interface, "all"], + "update-entries" => [\$arp_update, "false"], }, "server" => { "ldap-uri" => [\$ldap_uri, ""], @@ -171,7 +172,7 @@ sub got_packet { if(!exists($hosts_database->{$packet->{source_haddr}})) { 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})) { + if(exists($ldap_result->{dn}) and $arp_update eq "true") { $hosts_database->{$packet->{source_haddr}}=$ldap_result; $hosts_database->{$packet->{source_haddr}}->{dnsname}= $dnsname; if(!exists($ldap_result->{ipHostNumber})) { @@ -210,7 +211,7 @@ sub got_packet { } $hosts_database->{$packet->{source_haddr}}->{device}= $capture_device; } else { - if(!($hosts_database->{$packet->{source_haddr}}->{ipHostNumber} eq $packet->{source_ipaddr})) { + if(($arp_update eq "true") and !($hosts_database->{$packet->{source_haddr}}->{ipHostNumber} eq $packet->{source_ipaddr})) { &main::daemon_log( "IP Address change of MAC ".$packet->{source_haddr}. ": ".$hosts_database->{$packet->{source_haddr}}->{ipHostNumber}.