From prvs=333040239=Ian.Jackson@citrix.com Fri Jun 16 16:17:38 2017 MIME-Version: 1.0 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.0 X-Mailer: VM 8.2.0b under 24.4.1 (i586-pc-linux-gnu) Message-ID: <22852.1178.739306.875419@mariner.uk.xensource.com> content-type: text/plain; charset="utf-8" X-Ironport-Av: E=Sophos;i="5.39,347,1493683200"; d="scan'208";a="428217902" Received: from mx.pao1.isc.org (mx.pao1.isc.org [149.20.64.53]) by bugs.isc.org (Postfix) with ESMTP id 8651071B5A8 for ; Fri, 16 Jun 2017 16:17:38 +0000 (UTC) Received: from SMTP.CITRIX.COM (smtp.citrix.com [66.165.176.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx.pao1.isc.org (Postfix) with ESMTPS id DF06F3493C7 for ; Fri, 16 Jun 2017 16:17:35 +0000 (UTC) Delivered-To: dhcp-bugs@bugs.isc.org Subject: omapi leases query ignores state Return-Path: X-Original-To: dhcp-bugs@bugs.isc.org Date: Fri, 16 Jun 2017 17:17:30 +0100 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mx.pao1.isc.org To: dhcp-bugs@isc.org Content-Transfer-Encoding: 7bit From: "Ian Jackson" X-RT-Original-Encoding: ascii X-RT-Interface: Email Content-Length: 1117 When looking up a lease via omapi, the dhcpd ignores the "state" field of the query key object. This can prevent the query from working at all, because there can easily be multiple objects which are distinguished only by "state": > new lease obj: lease > set hardware-address = 5a:36:0e:9d:00:01 obj: lease hardware-address = 5a:36:0e:9d:00:01 > open can't open object: more than one object matches key obj: lease hardware-address = 5a:36:0e:9d:00:01 > set state = 00:00:00:02 obj: lease hardware-address = 5a:36:0e:9d:00:01 state = 00:00:00:02 > open can't open object: more than one object matches key obj: lease hardware-address = 5a:36:0e:9d:00:01 state = 00:00:00:02 > This bug seems to be described here: https://lists.isc.org/pipermail/dhcp-hackers/2005-August/001399.html Sadly no-one seems to have given any useful pointers to Robin Breathe in 2005 and the bug remains unfixed at least in my current distro. As as result, the "lookup_ip" function in pypureomapi does not work reliably (and cannot be made to work reliably). (I'm using Debian's isc-dhcp-server version 4.2.2.dfsg.1-5+deb70u8.) Ian.