Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIND 9.16 compatibility #67

Closed
sthen opened this issue Feb 25, 2020 · 9 comments · Fixed by #72
Closed

BIND 9.16 compatibility #67

sthen opened this issue Feb 25, 2020 · 9 comments · Fixed by #72

Comments

@sthen
Copy link

sthen commented Feb 25, 2020

BIND 9.16 removes isc-config.sh and changes API of isc_mem_create() and isc_buffer_allocate(). I don't have time to do a full PR-ready diff with autoconf checks to make it work with either version, but to hopefully save someone else a bit of time, this is what I'm using in the OpenBSD port for now.

The API changes were in isc-projects/bind9@1b716a3 and isc-projects/bind9@4459745

Index: src/dns.c
--- src/dns.c.orig
+++ src/dns.c
@@ -137,10 +137,7 @@ perf_dns_createctx(bool updates)
         return NULL;
 
     mctx   = NULL;
-    result = isc_mem_create(0, 0, &mctx);
-    if (result != ISC_R_SUCCESS)
-        perf_log_fatal("creating memory context: %s",
-            isc_result_totext(result));
+    isc_mem_create(&mctx);
 
     ctx = isc_mem_get(mctx, sizeof(*ctx));
     if (ctx == NULL) {
@@ -373,9 +370,7 @@ perf_dns_parseednsoption(const char* arg, isc_mem_t* m
 
     option->mctx   = mctx;
     option->buffer = NULL;
-    result         = isc_buffer_allocate(mctx, &option->buffer, strlen(value) / 2 + 4);
-    if (result != ISC_R_SUCCESS)
-        perf_log_fatal("out of memory");
+    isc_buffer_allocate(mctx, &option->buffer, strlen(value) / 2 + 4);
 
     result = isc_parse_uint16(&code, copy, 0);
     if (result != ISC_R_SUCCESS) {

Index: src/dnsperf.c
--- src/dnsperf.c.orig
+++ src/dnsperf.c
@@ -389,10 +389,7 @@ setup(int argc, char** argv, config_t* config)
     isc_result_t result;
     const char*  mode = 0;
 
-    result = isc_mem_create(0, 0, &mctx);
-    if (result != ISC_R_SUCCESS)
-        perf_log_fatal("creating memory context: %s",
-            isc_result_totext(result));
+    isc_mem_create(&mctx);
 
     dns_result_register();
 
Index: src/resperf.c
--- src/resperf.c.orig
+++ src/resperf.c
@@ -226,10 +226,7 @@ setup(int argc, char** argv)
     isc_result_t result;
     const char*  _mode = 0;
 
-    result = isc_mem_create(0, 0, &mctx);
-    if (result != ISC_R_SUCCESS)
-        perf_log_fatal("creating memory context: %s",
-            isc_result_totext(result));
+    isc_mem_create(&mctx);
 
     dns_result_register();
 
@jelu
Copy link
Member

jelu commented May 8, 2020

Thanks for the patch but with the recent changes to BIND, specifically the statement that their libraries should not be used outside of BIND and the removal of isc-config.sh, I think we need to remove this dependency completely...

@neirbowj
Copy link

Heads-up: dnsperf was removed from the FreeBSD ports tree when BIND 9.14 expired on 04/30.

@jelu
Copy link
Member

jelu commented May 13, 2020

@neirbowj Thanks for the info, sadly it's not an easy fix...

@neirbowj
Copy link

Should I be able to build against BIND 9.11? That might be an easy way to get dnsperf back into the ports tree for the time being.

@sthen
Copy link
Author

sthen commented May 13, 2020

Yes, or my patches do work (you'll need to zap the autoconf check for isc-config and just use -lbind9 instead of isc-config --libs).

@jelu
Copy link
Member

jelu commented May 13, 2020

@neirbowj Yes, you can build against 9.11

@sthen Well, that is only a quick fix in the short run. ISC have stated that their libraries are not for use outside of BIND.

@pemensik pemensik mentioned this issue May 14, 2020
@pemensik
Copy link
Contributor

Hi. I have modified those changes to autodetection. This way, it is still able to compile with BIND 9.11, but also with BIND 9.16. It does still depend on bind libraries however.

@pemensik
Copy link
Contributor

It seems to me I solved also issue #23, because I hit error in Fedora with symbol missing symbol ERR_get_error. -lcrypto seems mandatory with OpenSSL 1.1

jelu added a commit to jelu/dnsperf that referenced this issue May 14, 2020
- Close DNS-OARC#71: Pull @pemensik changes to add other
- Fix DNS-OARC#67: Workaround for BIND 9.16
- Fix DNS-OARC#23: Remove use of static libcrypto
- Update formatting based on latest `clang-format`
@jelu jelu closed this as completed in #72 May 14, 2020
@jelu
Copy link
Member

jelu commented May 14, 2020

THANK YOU @pemensik !!!! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants