Bug 217640 - dns/nsd can't build 4.1.15 from ports
Summary: dns/nsd can't build 4.1.15 from ports
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jason Unovitch
Depends on:
Reported: 2017-03-08 14:57 UTC by Max Kostikov
Modified: 2017-03-17 02:17 UTC (History)
3 users (show)

See Also:
jaap: maintainer-feedback+

patch to fix (1.56 KB, patch)
2017-03-09 16:16 UTC, Jaap Akkerhuis
jaap: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Max Kostikov 2017-03-08 14:57:18 UTC
Trying to update NSD from ports I got build error.
--- query.o ---
./query.c:667:50: error: use of undeclared identifier 'rbnode_t'
                        memcpy(&temp->node, &additional->node, sizeof(rbnode_t));
./query.c:1116:54: error: use of undeclared identifier 'rbnode_t'
                memcpy(&match->node, &wildcard_child->node, sizeof(rbnode_t));
2 errors generated.
*** [query.o] Error code 1

make[2]: stopped in /usr/ports/dns/nsd/work/nsd-4.1.15
1 error

make[2]: stopped in /usr/ports/dns/nsd/work/nsd-4.1.15
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

make[1]: stopped in /usr/ports/dns/nsd
*** Error code 1

make: stopped in /usr/ports/dns/nsd

Here is build options.
# make showconfig | grep on
===> The following configuration options are available for nsd-4.1.15:
     DOCS=on: Build and/or install documentation
     IPV6=on: IPv6 protocol support
     LARGEFILE=on: Largefile support
     MINRESPSIZE=on: Minimial response sizing
     NSEC3=on: NSEC3 support
     ROOT_SERVER=off: Configure as a root server
     RRL=on: Response Rate Limiting
     ZONE_STATS=off: Separate statistics for each zone
===> Use 'make config' to modify these settings

# uname -v
FreeBSD 11.0-RELEASE-p8 #0: Wed Feb 22 06:12:04 UTC 2017     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC
Comment 1 Walter Schwarzenfeld freebsd_triage 2017-03-08 16:23:50 UTC
This error appears if RADIXTREE is on.
Comment 2 Walter Schwarzenfeld freebsd_triage 2017-03-08 16:26:11 UTC
Sorry not on. The error appears if RADIXTREE is off (default is on).
Comment 3 Max Kostikov 2017-03-08 20:21:08 UTC
Yes, with RADIXTREE on its works.
But I think that this issue must be fixed.
Comment 4 Walter Schwarzenfeld freebsd_triage 2017-03-08 21:09:44 UTC
By the way t,  you wrote the wrong category it is dns/nsd.
Comment 5 Max Kostikov 2017-03-09 10:31:46 UTC
(In reply to w.schwarzenfeld from comment #4)
Yes, it's my fault. Of course dns/nsd will be correct.
Comment 6 Walter Schwarzenfeld freebsd_triage 2017-03-09 10:43:25 UTC
Please, correct the title.
If I am right, this should be the solution:

--- query.c.orig        2017-03-08 21:16:20 UTC
+++ query.c
@@ -664,7 +664,7 @@ add_additional_rrsets(struct query *quer
                        temp->rnode = NULL;
                        temp->dname = additional->dname;
-                       memcpy(&temp->node, &additional->node, sizeof(rbnode_t));
+                       memcpy(&temp->node, &additional->node, sizeof(rbnode_type));
                        temp->node.parent = NULL;
                        temp->number = additional->number;
@@ -1113,7 +1113,7 @@ answer_authoritative(struct nsd   *nsd,
                match->rnode = NULL;
                match->dname = wildcard_child->dname;
-               memcpy(&match->node, &wildcard_child->node, sizeof(rbnode_t));
+               memcpy(&match->node, &wildcard_child->node, sizeof(rbnode_type));
                match->node.parent = NULL;
                match->parent = closest_encloser;
Comment 7 Jaap Akkerhuis 2017-03-09 16:16:34 UTC
Created attachment 180673 [details]
patch to fix

The suggested fix is correct (checked with the upstream). See also this attachment which include the PORTREVISION bump in the Makefile.
Comment 8 Jaap Akkerhuis 2017-03-11 10:54:04 UTC
*** Bug 217537 has been marked as a duplicate of this bug. ***
Comment 9 commit-hook freebsd_committer 2017-03-17 02:15:38 UTC
A commit references this bug:

Author: junovitch
Date: Fri Mar 17 02:14:39 UTC 2017
New revision: 436315
URL: https://svnweb.freebsd.org/changeset/ports/436315

  dns/nsd: Fix missing _t to _type conversion for disable-radix-tree option

  - Noting NSD changelog, recent update renamed _t typedefs because POSIX
    reserves them. The 4.1.15 update missed a few conversion.
  - Unbreak RADIXTREE. No PORTREVISION change as port would not have built.

  PR:		217640
  Reported by:	Max Kostikov <max@kostikov.co>
  Submitted by:	w.schwarzenfeld@utanet.at (the suggested diff)
  		jaap@NLnetLabs.nl (maintainer - the port patch)
  Obtained from:	nsd svn r4741

Comment 10 Jason Unovitch freebsd_committer 2017-03-17 02:17:37 UTC
Thanks for the collaboration on this and sorry for the delay in application of the patch. I saw the ping to bug 217537 following my commit to update to 4.1.15 but have been swamped lately.