[Git][NTPsec/ntpsec][master] Address GitLab issue Issue #13: DNS lookup broken in obscure cases

Eric S. Raymond gitlab at mg.gitlab.com
Tue Oct 11 12:36:47 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
7e61aeb9 by Eric S. Raymond at 2016-10-11T08:33:15-04:00
Address GitLab issue  Issue #13: DNS lookup broken in obscure cases

This is "A hack good-enough solution would be to make the array bigger."
Before this change the default array sizes were absurdly small, as though
RAM still cost the way it did in 1990 or whenever.

Also added: a note in devel/TODO that this whole mess ought to be replaced
by something like c_ares.

- - - - -


2 changed files:

- devel/TODO
- libntp/work_thread.c


Changes:

=====================================
devel/TODO
=====================================
--- a/devel/TODO
+++ b/devel/TODO
@@ -91,6 +91,11 @@ Neither is ideal, easy pickings for someone to code on.
   (and multiple inbound NTP connections, and a hole in your firewall) even when
   it has a known-good local timesource like a GPS.  This should be fixed.
 
+* The code used for asynchronous DNS lookup is more general, moere complex,
+  and more bug-prone than it should be.  Either our version should be
+  rewritten and simplified or (better idea!) it should be replaced by
+  a well-maintained third-party library like c_ares.
+
 * Hal says "We need a way to inspect/debug bits on the wire. `ntpdate
   -du' is the traditional approach."  Hal's straw man is a new program
   rather than trying to make ntpdig do this.  Eric's proposed answer:


=====================================
libntp/work_thread.c
=====================================
--- a/libntp/work_thread.c
+++ b/libntp/work_thread.c
@@ -22,8 +22,8 @@
 
 #define CHILD_EXIT_REQ	((blocking_pipe_header *)(intptr_t)-1)
 #define CHILD_GONE_RESP	CHILD_EXIT_REQ
-#define WORKITEMS_ALLOC_INC	16
-#define RESPONSES_ALLOC_INC	4
+#define WORKITEMS_ALLOC_INC	64
+#define RESPONSES_ALLOC_INC	16
 
 #ifdef OVERRIDE_THREAD_MINSTACKSIZE
 #define THREAD_MINSTACKSIZE OVERRIDE_THREAD_MINSTACKSIZE



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/7e61aeb90c9b7f4f72cff1f15b68e81415fe0545
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161011/626adb30/attachment.html>


More information about the vc mailing list