summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>2019-03-01 13:26:48 +0100
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>2019-03-01 13:26:48 +0100
commit23f8bdb40c7feae0cc3e5e1e75126065da4c69c8 (patch)
tree008807dbb22d90cd1c975849bd7c1909a6e3fcc0
parent411c97d549bc9bf9b87fce33cd697d920b0d5acc (diff)
downloadldns-23f8bdb40c7feae0cc3e5e1e75126065da4c69c8.tar.gz
* Fix that ldns-testns ignores sigpipe.
-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");