[Pkg-freeipa-devel] [Git][freeipa-team/bind-dyndb-ldap][upstream] 2 commits: Use correct final reference counter value for 9.11 and 9.16

Timo Aaltonen gitlab at salsa.debian.org
Tue Dec 1 14:47:24 GMT 2020



Timo Aaltonen pushed to branch upstream at FreeIPA packaging / bind-dyndb-ldap


Commits:
4d906bdf by Alexander Bokovoy at 2020-11-23T15:49:56+02:00
Use correct final reference counter value for 9.11 and 9.16

With the commit 542096278ba605a5800348a6c31dc058685860de, reference
counting uses C11 semantics due to

    bind-9.16: Correct reference counting

    With [0] BIND atomic functions for reference counting have the
    identical interface as their C11 counter parts. This means that
    these functions return the _previous_ refcount instead of the
    current one.

    [0]: https://gitlab.isc.org/isc-projects/bind9/-/commit/bef8ac5bae0f95dbff76ec99a7994024a5d6c64e

Since the same code is compiled for both 9.11 and 9.16, we need to make
sure the logic to detect final reference counter value in destructors
follows two different reference counting interface semantics.

Define REFCOUNT_FLOOR to help with that depending on the libdns major
version.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1899744

Signed-off-by: Alexander Bokovoy <abokovoy at redhat.com>

- - - - -
443dce8a by Alexander Bokovoy at 2020-11-23T15:58:09+02:00
Update version to 11.6

Signed-off-by: Alexander Bokovoy <abokovoy at redhat.com>

- - - - -


4 changed files:

- configure.ac
- contrib/bind-dyndb-ldap.spec
- src/ldap_driver.c
- src/syncrepl.c


Changes:

=====================================
configure.ac
=====================================
@@ -1,5 +1,5 @@
 AC_PREREQ([2.59])
-AC_INIT([bind-dyndb-ldap], [11.5], [freeipa-devel at redhat.com])
+AC_INIT([bind-dyndb-ldap], [11.6], [freeipa-devel at redhat.com])
 
 AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2])
 


=====================================
contrib/bind-dyndb-ldap.spec
=====================================
@@ -3,7 +3,7 @@
 %define bind_version 32:9.11.17-1
 
 Name:           bind-dyndb-ldap
-Version:        11.5
+Version:        11.6
 Release:        0%{?dist}
 Summary:        LDAP back-end plug-in for BIND
 
@@ -116,6 +116,10 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Mon Nov 23 2020 Alexander Bokovoy <abokovoy at redhat.com>
+- Release 11.6
+- Make sure build against 9.11 uses 9.11's reference counting logic
+
 * Mon Sep 21 2020 Alexander Bokovoy <abokovoy at redhat.com>
 - Release 11.5
 - Fix bind 9.16 support


=====================================
src/ldap_driver.c
=====================================
@@ -54,7 +54,9 @@
 
 #if LIBDNS_VERSION_MAJOR < 1600
 typedef dns_name_t       node_name_t;
+#define REFCOUNT_FLOOR 0
 #else
+#define REFCOUNT_FLOOR 1
 typedef const dns_name_t node_name_t;
 #endif
 
@@ -195,7 +197,7 @@ detach(dns_db_t **dbp)
 	refs = isc_refcount_decrement(&ldapdb->refs);
 #endif
 
-	if (refs == 1) {
+	if (refs == REFCOUNT_FLOOR) {
 		free_ldapdb(ldapdb);
 	}
 }


=====================================
src/syncrepl.c
=====================================
@@ -20,6 +20,12 @@
 #define LDAPDB_EVENT_SYNCREPL_BARRIER	(LDAPDB_EVENTCLASS + 2)
 #define LDAPDB_EVENT_SYNCREPL_FINISH	(LDAPDB_EVENTCLASS + 3)
 
+#if LIBDNS_VERSION_MAJOR < 1600
+#define REFCOUNT_FLOOR 0
+#else
+#define REFCOUNT_FLOOR 1
+#endif
+
 /** How many unprocessed LDAP events from syncrepl can be in event queue.
  *  Adding new events into the queue is blocked until some events
  *  are processed. */
@@ -209,7 +215,7 @@ barrier_decrement(isc_task_t *task, isc_event_t *event) {
 #else
 	cnt = isc_refcount_decrement(&bev->sctx->task_cnt);
 #endif
-	if (cnt == 1) {
+	if (cnt == REFCOUNT_FLOOR) {
 		sync_barrierev_t *fev = NULL;
 		isc_event_t *ev = NULL;
 



View it on GitLab: https://salsa.debian.org/freeipa-team/bind-dyndb-ldap/-/compare/afb91b7160e0e309d37deee7235a95eb360bf08c...443dce8a5130513b1a552e707fadaebc542653de

-- 
View it on GitLab: https://salsa.debian.org/freeipa-team/bind-dyndb-ldap/-/compare/afb91b7160e0e309d37deee7235a95eb360bf08c...443dce8a5130513b1a552e707fadaebc542653de
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-freeipa-devel/attachments/20201201/05aab8fc/attachment-0001.html>


More information about the Pkg-freeipa-devel mailing list