From 721c78c9e05a49a3291364283225b552debb879e Mon Sep 17 00:00:00 2001 From: Bernd Kuhls Date: Sat, 29 Aug 2015 12:53:38 +0200 Subject: [PATCH] package/libldns: new package Needed by freeswitch. Signed-off-by: Bernd Kuhls Signed-off-by: Thomas Petazzoni --- package/Config.in | 1 + ...le-free-for-answers-bigger-than-4096.patch | 25 +++++++++++ ...fix-whitespace-bug-in-ldns-read-zone.patch | 45 +++++++++++++++++++ package/libldns/Config.in | 9 ++++ package/libldns/libldns.hash | 4 ++ package/libldns/libldns.mk | 36 +++++++++++++++ 6 files changed, 120 insertions(+) create mode 100644 package/libldns/0001-fix-double-free-for-answers-bigger-than-4096.patch create mode 100644 package/libldns/0002-fix-whitespace-bug-in-ldns-read-zone.patch create mode 100644 package/libldns/Config.in create mode 100644 package/libldns/libldns.hash create mode 100644 package/libldns/libldns.mk diff --git a/package/Config.in b/package/Config.in index 72fcbc92b5..68b3aa8f15 100644 --- a/package/Config.in +++ b/package/Config.in @@ -990,6 +990,7 @@ menu "Networking" source "package/libhttpparser/Config.in" source "package/libidn/Config.in" source "package/libiscsi/Config.in" + source "package/libldns/Config.in" source "package/libmbus/Config.in" source "package/libmemcached/Config.in" source "package/libmicrohttpd/Config.in" diff --git a/package/libldns/0001-fix-double-free-for-answers-bigger-than-4096.patch b/package/libldns/0001-fix-double-free-for-answers-bigger-than-4096.patch new file mode 100644 index 0000000000..36bc8753c5 --- /dev/null +++ b/package/libldns/0001-fix-double-free-for-answers-bigger-than-4096.patch @@ -0,0 +1,25 @@ +Downloaded from +http://anonscm.debian.org/cgit/pkg-nlnetlabs/ldns.git/plain/debian/patches/fix-double-free-for-answers-bigger-than-4096.patch + +which is a backport from upstream +http://git.nlnetlabs.nl/ldns/commit/?h=develop&id=2853eb352b4461e98f2926ace4ea3810cedf4167 + +Signed-off-by: Bernd Kuhls + +From 2853eb352b4461e98f2926ace4ea3810cedf4167 Mon Sep 17 00:00:00 2001 +From: Willem Toorop +Date: Tue, 28 Jan 2014 11:06:38 +0100 +Subject: bugfix #548: Double free for answers > 4096 + +in ldns_resolver_send_pkt. Thank you sunthought@gmail.com +--- +--- ldns.orig/resolver.c ++++ ldns/resolver.c +@@ -1117,6 +1117,7 @@ ldns_resolver_send_pkt(ldns_pkt **answer + ldns_pkt_set_edns_udp_size(query_pkt + , 4096); + ldns_pkt_free(answer_pkt); ++ answer_pkt = NULL; + /* Nameservers should not become + * unreachable because fragments are + * dropped (network error). We might diff --git a/package/libldns/0002-fix-whitespace-bug-in-ldns-read-zone.patch b/package/libldns/0002-fix-whitespace-bug-in-ldns-read-zone.patch new file mode 100644 index 0000000000..4d8908eb40 --- /dev/null +++ b/package/libldns/0002-fix-whitespace-bug-in-ldns-read-zone.patch @@ -0,0 +1,45 @@ +Dwonloaded from +http://anonscm.debian.org/cgit/pkg-nlnetlabs/ldns.git/tree/debian/patches/fix-whitespace-bug-in-ldns-read-zone.patch + +which is a backport from +http://git.nlnetlabs.nl/ldns/commit/?h=develop&id=d6037a22fbedb8ef3a22de4107e4eaa36840865b + +Signed-off-by: Bernd Kuhls + +From d6037a22fbedb8ef3a22de4107e4eaa36840865b Mon Sep 17 00:00:00 2001 +From: Matthijs Mekking +Date: Wed, 18 Jun 2014 09:55:17 +0200 +Subject: whitespace bug in ldns-read-zone + +--- +--- ldns.orig/rr.c ++++ ldns/rr.c +@@ -670,6 +670,18 @@ ldns_rr_new_question_frm_str(ldns_rr **n + true); + } + ++static int ++ldns_rr_is_whitespace_line(char* line, int line_len) ++{ ++ int i; ++ for (i = 0; i < line_len; i++) { ++ if (!isspace((int)line[i])) { ++ return 0; ++ } ++ } ++ return 1; ++} ++ + ldns_status + ldns_rr_new_frm_fp(ldns_rr **newrr, FILE *fp, uint32_t *ttl, ldns_rdf **origin, ldns_rdf **prev) + { +@@ -745,6 +757,9 @@ ldns_rr_new_frm_fp_l(ldns_rr **newrr, FI + s = LDNS_STATUS_SYNTAX_TTL; + } else if (strncmp(line, "$INCLUDE", 8) == 0) { + s = LDNS_STATUS_SYNTAX_INCLUDE; ++ } else if (ldns_rr_is_whitespace_line(line, size)) { ++ LDNS_FREE(line); ++ return LDNS_STATUS_SYNTAX_EMPTY; + } else { + if (origin && *origin) { + s = ldns_rr_new_frm_str(&rr, (const char*) line, ttl, *origin, prev); diff --git a/package/libldns/Config.in b/package/libldns/Config.in new file mode 100644 index 0000000000..12065ae2f1 --- /dev/null +++ b/package/libldns/Config.in @@ -0,0 +1,9 @@ +config BR2_PACKAGE_LIBLDNS + bool "libldns" + help + The goal of ldns is to simplify DNS programming, it supports + recent RFCs like the DNSSEC documents, and allows developers + to easily create software conforming to current RFCs, and + experimental software for current Internet Drafts. + + http://www.nlnetlabs.nl/projects/ldns diff --git a/package/libldns/libldns.hash b/package/libldns/libldns.hash new file mode 100644 index 0000000000..3565c5830a --- /dev/null +++ b/package/libldns/libldns.hash @@ -0,0 +1,4 @@ +# From http://www.nlnetlabs.nl/downloads/ldns/ldns-1.6.17.tar.gz.sha1 +sha1 4218897b3c002aadfc7280b3f40cda829e05c9a4 ldns-1.6.17.tar.gz +# Locally calculated +sha256 8b88e059452118e8949a2752a55ce59bc71fa5bc414103e17f5b6b06f9bcc8cd ldns-1.6.17.tar.gz diff --git a/package/libldns/libldns.mk b/package/libldns/libldns.mk new file mode 100644 index 0000000000..9a284040ea --- /dev/null +++ b/package/libldns/libldns.mk @@ -0,0 +1,36 @@ +################################################################################ +# +# libldns +# +################################################################################ + +LIBLDNS_VERSION = 1.6.17 +LIBLDNS_SOURCE = ldns-$(LIBLDNS_VERSION).tar.gz +LIBLDNS_SITE = http://www.nlnetlabs.nl/downloads/ldns +LIBLDNS_LICENSE = BSD-3c +LIBLDNS_LICENSE_FILES = LICENSE +LIBLDNS_INSTALL_STAGING = YES +LIBLDNS_CONF_OPTS = \ + --without-examples \ + --without-p5-dns-ldns \ + --without-pyldns \ + --without-pyldnsx + +ifeq ($(BR2_PACKAGE_OPENSSL),y) +LIBLDNS_DEPENDENCIES += host-pkgconf openssl +LIBLDNS_CONF_OPTS += \ + --with-ssl=$(STAGING_DIR)/usr \ + --enable-dane \ + --enable-ecdsa \ + --enable-gost \ + --enable-sha2 +else +LIBLDNS_CONF_OPTS += \ + --without-ssl \ + --disable-dane \ + --disable-ecdsa \ + --disable-gost \ + --disable-sha2 +endif + +$(eval $(autotools-package)) -- 2.30.2