[Bug Report] key conflict message for create host by OMAPI

Clodoaldo de Borba Lambiase clodoaldo at cpd.ufrgs.br
Thu Nov 5 18:37:49 UTC 2015


Hi,
I had first reported my problem on this topic below:
https://lists.isc.org/pipermail/dhcp-users/2015-October/019267.html

There, I have described the server setups, dhcp files and the exact problem.

I would like something like that via OMAPI:

host 10.179.48.34 {
  dynamic;
  hardware ethernet ee:ff:cc:52:55:f1;
  fixed-address 10.179.48.34;
}

host 10.179.49.34{
  dynamic;
  hardware ethernet ee:ff:cc:52:55:f1;
  fixed-address 10.179.49.34;
}

It is a little different from what people have suggested because I would like to be able to remove and insert 'host' entries by omapi using the ip as unique identifier.
Without use the IP as unique identifier I would have to update or remove and reinsert the host entry.

Solution suggested by Steve is a nice idea and seems it works fine. But, nowadays, our system uses ip as unique identifier and it will be hard to change the concept.

I have a patch to solve this problem but I think that is not the best way to solve this problem. I disabled the "key_conflict" test to allow Omapi host entries with the same MAC for different IPs.
Here, I am reproducing the patch if someone want.

Clodoaldo.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
diff -rupN dhcp-4.3.3.original/dhcp-4.3.3/bind/bindvar.tmp dhcp-4.3.3/bind/bindvar.tmp
--- dhcp-4.3.3.original/dhcp-4.3.3/bind/bindvar.tmp     1969-12-31 21:00:00.000000000 -0300
+++ dhcp-4.3.3/bind/bindvar.tmp 2015-10-21 17:23:25.577897768 -0200
@@ -0,0 +1,2 @@
+binddir=/home/clodoaldo/Softwares/dhcp-4.3.3/bind
+GMAKE=make
diff -rupN dhcp-4.3.3.original/dhcp-4.3.3/config.report dhcp-4.3.3/config.report
--- dhcp-4.3.3.original/dhcp-4.3.3/config.report        1969-12-31 21:00:00.000000000 -0300
+++ dhcp-4.3.3/config.report    2015-10-21 17:23:25.581897758 -0200
@@ -0,0 +1,23 @@
+
+     ISC DHCP source configure results:
+    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+Package:
+  Name:          DHCP
+  Version:       4.3.3
+
+C Compiler:      gcc
+
+Flags:
+  DEFS:          -DHAVE_CONFIG_H
+  CFLAGS:        -g -O2  -Wall -Werror -fno-strict-aliasing -I${top_srcdir}/bind/include
+
+Features:
+  debug:         no
+  failover:
+  execute:
+  binary-leases:
+
+Developer:
+  ATF unittests : no
+
diff -rupN dhcp-4.3.3.original/dhcp-4.3.3/omapip/message.c dhcp-4.3.3/omapip/message.c
--- dhcp-4.3.3.original/dhcp-4.3.3/omapip/message.c     2015-08-26 16:13:14.000000000 -0300
+++ dhcp-4.3.3/omapip/message.c 2015-10-21 17:13:03.047372524 -0200
@@ -29,6 +29,7 @@
 #include "dhcpd.h"

 #include <omapip/omapip_p.h>
+#include <omapip/result.h>

 OMAPI_OBJECT_ALLOC (omapi_message,
                    omapi_message_object_t, omapi_type_message)
@@ -536,6 +537,7 @@ omapi_message_process_internal (omapi_ob

                if (status != ISC_R_SUCCESS &&
                    status != ISC_R_NOTFOUND &&
+               status != DHCP_R_KEYCONFLICT &&
                    status != DHCP_R_NOKEYS) {
                        return omapi_protocol_send_status
                                (po, message -> id_object,




More information about the dhcp-users mailing list