X-Scanned-BY: MIMEDefang 2.68 on 10.5.11.26 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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 Content-Type: text/plain; charset=utf-8; format=flowed Message-ID: <541708A1.3080509@redhat.com> Organization: Red Hat Received: from mx.ams1.isc.org (mx.ams1.isc.org [199.6.1.65]) by bugs.isc.org (Postfix) with ESMTP id 94A692D20571 for ; Mon, 15 Sep 2014 15:41:28 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.redhat.com", Issuer "DigiCert SHA2 Extended Validation Server CA" (not verified)) by mx.ams1.isc.org (Postfix) with ESMTPS id 4B9AF1FCB89 for ; Mon, 15 Sep 2014 15:41:25 +0000 (UTC) Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8FFfN5F005251 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 15 Sep 2014 11:41:24 -0400 Received: from pspacek.brq.redhat.com (pspacek.brq.redhat.com [10.34.128.7]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s8FFfMj7031357 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Mon, 15 Sep 2014 11:41:23 -0400 Delivered-To: bind9-bugs@bugs.isc.org User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 Subject: dns_name_fullcompare() doesn't fill nlabelsp correctly if names are equal Return-Path: X-Original-To: bind9-bugs@bugs.isc.org Date: Mon, 15 Sep 2014 17:41:21 +0200 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mx.ams1.isc.org To: bind9-bugs@isc.org Content-Transfer-Encoding: 7bit From: Petr Spacek X-RT-Original-Encoding: utf-8 Content-Length: 665 Hello, I just found out that dns_name_fullcompare() description is not correct or the function contains a bug. name.h promises this: dns_namereln_t dns_name_fullcompare(const dns_name_t *name1, const dns_name_t *name2, int *orderp, unsigned int *nlabelsp); * Ensures: * *\li *orderp is < 0 if name1 < name2, 0 if name1 = name2, > 0 if * name1 > name2. * *\li *nlabelsp is the number of common significant labels. The promise "nlabelsp is the number of common significant labels" is not fulfilled in this case: if (name1 == name2) { *orderp = 0; return (dns_namereln_equal); } Have a nice day! -- Petr Spacek @ Red Hat