>>
>> [Question 2: not solved]
>> So far I could identify these 3 mysql inserts that mysqld complains
>> about when re-invoked by pfcmd service pf restart:
>> query dhcp_fingerprint_add_sql called from
>> pf::os::read_dhcp_fingerprints_conf (pf::db::db_query_execute)
>> query node_add_sql called from pf::node::node_add (pf::db::db_query_execute)
>> query os_mapping_add_sql called from pf::os::read_dhcp_fingerprints_conf
>> (pf::db::db_query_execute)
>>
>> So far, I could only take a closer look at read_dhcp_fingerprints_conf.
>> The SQL insert that leads to a 'Duplicate entry error' is executed if
>> the trigger_in_range function from trigger.pm returns 1. This is the
>> case if $trigger>= $begin&&  $trigger<= $end. I don't quite understand
>> the sense of this code, nonetheless, this condition seems to be always
>> true if the data is sourced from the dhcp_fingerprints.conf file.
>> One example:
>> OS class 17, members 1700-1799
>> OS 1705
>> In trigger_in_range language:
>> Trigger: 1705, Begin: 1700, End: 1799
>> Hence, trigger_in_range returns 1, read_dhcp_fingerprints_conf executes
>> dhcp_fingerprint_add_sql and then fails with 'Duplicate entry error'.
>>
>> Can you please help me out?
>
> read_dhcp_fingerprints_conf is one of the ugly piece I've yet to dig
> into, I'm afraid there's nothing I could do in a timely fashion and we
> are pretty busy right now..

Thanks for looking into it.
As I said, I don't quite understand the meaning of the code snipplet in 
trigger.pm in the bigger context of packetfence. Could you quickly 
explain what it is good for? Or, the other way 'round, would it be safe 
to comment out this piece of code, like I did here?

--- /root/pf-2.2.1/usr/local/pf/lib/pf/trigger.pm       2011-05-03 
16:51:19.000000000 +0200
+++ trigger.pm  2011-07-15 17:03:27.205334228 +0200
@@ -186,13 +186,17 @@ sub trigger_add {
  sub trigger_in_range {
      my ( $range, $trigger ) = @_;
      foreach my $element ( split( /\s*,\s*/, $range ) ) {
              return (1);
-        } elsif ( $element =~ /^\d+\s*\-\s*\d+$/ ) {
-            my ( $begin, $end ) = split( /\s*\-\s*/, $element );
-            if ( $trigger >= $begin && $trigger <= $end ) {
-                return (1);
-            }
+        # what exactly is the sense of this code?
+        #} elsif ( $element =~ /^\d+\s*\-\s*\d+$/ ) {
+        #        return (1);
+        #    }
          } else {
              return (0);
          }

> Would you mind filing a bug report and maybe moving forward commenting
> out that feature? In the future I'll look more closely at your problem.

Yes, sure. Where?

Best wishes,
John

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Packetfence-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/packetfence-users

Reply via email to