summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog1
-rw-r--r--examples/ldns-testns.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/Changelog b/Changelog
index 68231448..808325d6 100644
--- a/Changelog
+++ b/Changelog
@@ -31,6 +31,7 @@
* ED25519 and ED448 support.
* ldns-notify: can have IPv6 address as argument.
* Fix time sensitive TSIG compare vulnerability.
+ * Fix that ldns-testns ignores sigpipe.
1.7.0 2016-12-20
* Fix lookup of relative names in ldns_resolver_search.
diff --git a/examples/ldns-testns.c b/examples/ldns-testns.c
index 885453d3..144b9457 100644
--- a/examples/ldns-testns.c
+++ b/examples/ldns-testns.c
@@ -147,6 +147,7 @@ struct sockaddr_storage;
#include <netinet/igmp.h>
#endif
#include <errno.h>
+#include <signal.h>
#define INBUF_SIZE 4096 /* max size for incoming queries */
#define DEFAULT_PORT 53 /* default if no -p port is specified */
@@ -499,6 +500,9 @@ main(int argc, char **argv)
log_msg("Reading datafile %s\n", datafile);
entries = read_datafile(datafile, 0);
+#ifdef SIGPIPE
+ (void)signal(SIGPIPE, SIG_IGN);
+#endif
#ifdef USE_WINSOCK
if(WSAStartup(MAKEWORD(2,2), &wsa_data) != 0)
error("WSAStartup failed\n");