summaryrefslogtreecommitdiff
path: root/pkg/nsd/patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/nsd/patch')
-rw-r--r--pkg/nsd/patch/0001-Remove-quotes-from-dbfile-in-man-pages.patch10
-rw-r--r--pkg/nsd/patch/0002-Use-timingsafe_memcmp-if-available.patch10
-rw-r--r--pkg/nsd/patch/0003-Avoid-pointer-arithmetic-on-void.patch180
-rw-r--r--pkg/nsd/patch/0004-Avoid-unnecessary-VLA.patch28
4 files changed, 10 insertions, 218 deletions
diff --git a/pkg/nsd/patch/0001-Remove-quotes-from-dbfile-in-man-pages.patch b/pkg/nsd/patch/0001-Remove-quotes-from-dbfile-in-man-pages.patch
index 57b668f5..c996bb47 100644
--- a/pkg/nsd/patch/0001-Remove-quotes-from-dbfile-in-man-pages.patch
+++ b/pkg/nsd/patch/0001-Remove-quotes-from-dbfile-in-man-pages.patch
@@ -1,4 +1,4 @@
-From 9eea05a128090e9466cc76755e4ae9d0859c0e26 Mon Sep 17 00:00:00 2001
+From d5b4c0724306c268c8e28c7cebe7cb1e09e8299d Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Sat, 14 Oct 2017 01:00:22 -0700
Subject: [PATCH] Remove quotes from @dbfile@ in man pages
@@ -31,10 +31,10 @@ index 5e488958..babaa06a 100644
.B NSD
database
diff --git a/nsd.conf.5.in b/nsd.conf.5.in
-index c7af7bec..c790e803 100644
+index b878cee2..15ad87be 100644
--- a/nsd.conf.5.in
+++ b/nsd.conf.5.in
-@@ -193,7 +193,7 @@ If yes, NSD listens to IPv6 connections. Default yes.
+@@ -203,7 +203,7 @@ If yes, NSD listens to IPv6 connections. Default yes.
.TP
.B database:\fR <filename>
By default
@@ -43,7 +43,7 @@ index c7af7bec..c790e803 100644
is used. The specified file is used to store the compiled
zone information. Same as commandline option
.BR \-f.
-@@ -916,7 +916,7 @@ also function as a resolver or cache. The configuration options that
+@@ -949,7 +949,7 @@ also function as a resolver or cache. The configuration options that
BIND9 has for the resolver or caching thus have no equivalents for NSD.
.SH "FILES"
.TP
@@ -53,5 +53,5 @@ index c7af7bec..c790e803 100644
.B NSD
database
--
-2.24.0
+2.25.1
diff --git a/pkg/nsd/patch/0002-Use-timingsafe_memcmp-if-available.patch b/pkg/nsd/patch/0002-Use-timingsafe_memcmp-if-available.patch
index adbd6fe1..fafcf4cc 100644
--- a/pkg/nsd/patch/0002-Use-timingsafe_memcmp-if-available.patch
+++ b/pkg/nsd/patch/0002-Use-timingsafe_memcmp-if-available.patch
@@ -1,4 +1,4 @@
-From 8bb168cfe8640134c5c654fdda91632c6f131aa9 Mon Sep 17 00:00:00 2001
+From a42ca948ea74b976d2186798ed1023d9db44e983 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Tue, 21 Aug 2018 15:52:34 -0700
Subject: [PATCH] Use timingsafe_memcmp if available
@@ -9,12 +9,12 @@ Subject: [PATCH] Use timingsafe_memcmp if available
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
-index 806d8fba..b8e498f3 100644
+index 52e410c2..ce0f5b17 100644
--- a/configure.ac
+++ b/configure.ac
@@ -628,7 +628,7 @@ AC_CHECK_SIZEOF(void*)
AC_CHECK_SIZEOF(off_t)
- AC_CHECK_FUNCS([arc4random arc4random_uniform])
+ AC_CHECK_FUNCS([getrandom arc4random arc4random_uniform])
AC_SEARCH_LIBS([setusercontext],[util],[AC_CHECK_HEADERS([login_cap.h])])
-AC_CHECK_FUNCS([tzset alarm chroot dup2 endpwent gethostname memset memcpy pwrite socket strcasecmp strchr strdup strerror strncasecmp strtol writev getaddrinfo getnameinfo freeaddrinfo gai_strerror sigaction sigprocmask strptime strftime localtime_r setusercontext glob initgroups setresuid setreuid setresgid setregid getpwnam mmap ppoll clock_gettime accept4])
+AC_CHECK_FUNCS([tzset alarm chroot dup2 endpwent gethostname memset memcpy pwrite socket strcasecmp strchr strdup strerror strncasecmp strtol writev getaddrinfo getnameinfo freeaddrinfo gai_strerror sigaction sigprocmask strptime strftime localtime_r setusercontext glob initgroups setresuid setreuid setresgid setregid getpwnam mmap ppoll clock_gettime accept4 timingsafe_memcmp])
@@ -22,7 +22,7 @@ index 806d8fba..b8e498f3 100644
AC_CHECK_TYPE([struct mmsghdr], AC_DEFINE(HAVE_MMSGHDR, 1, [If sys/socket.h has a struct mmsghdr.]), [], [
AC_INCLUDES_DEFAULT
diff --git a/tsig.c b/tsig.c
-index 91ca99b9..8c63ecfa 100644
+index 8b24fd1b..e75aa231 100644
--- a/tsig.c
+++ b/tsig.c
@@ -19,7 +19,9 @@
@@ -37,5 +37,5 @@ index 91ca99b9..8c63ecfa 100644
#define CRYPTO_memcmp memcmp_fixedtime
int memcmp_fixedtime(const void *s1, const void *s2, size_t n)
--
-2.24.0
+2.25.1
diff --git a/pkg/nsd/patch/0003-Avoid-pointer-arithmetic-on-void.patch b/pkg/nsd/patch/0003-Avoid-pointer-arithmetic-on-void.patch
deleted file mode 100644
index 976684fe..00000000
--- a/pkg/nsd/patch/0003-Avoid-pointer-arithmetic-on-void.patch
+++ /dev/null
@@ -1,180 +0,0 @@
-From ecde6ced1a7d7649510c5428646e2a96477f6c6f Mon Sep 17 00:00:00 2001
-From: Michael Forney <mforney@mforney.org>
-Date: Sun, 16 Jun 2019 23:17:47 -0700
-Subject: [PATCH] Avoid pointer arithmetic on `void *`
-Upstream: https://github.com/NLnetLabs/nsd/pull/60
-
-The pointer operand to the binary `+` operator must be to a complete
-object type.
----
- dbaccess.c | 8 ++++----
- difffile.c | 4 ++--
- region-allocator.c | 4 ++--
- udb.c | 12 ++++++------
- udb.h | 4 ++--
- xfrd.c | 2 +-
- 6 files changed, 17 insertions(+), 17 deletions(-)
-
-diff --git a/dbaccess.c b/dbaccess.c
-index da0762e9..87f75f9c 100644
---- a/dbaccess.c
-+++ b/dbaccess.c
-@@ -210,19 +210,19 @@ static void read_zone_recurse(udb_base* udb, namedb_type* db,
- /* pre-order process of node->elem, for radix tree this is
- * also in-order processing (identical to order tree_next()) */
- read_node_elem(udb, db, dname_region, zone, (struct domain_d*)
-- (udb->base + node->elem.data));
-+ ((char*)udb->base + node->elem.data));
- }
- if(node->lookup.data) {
- uint16_t i;
- struct udb_radarray_d* a = (struct udb_radarray_d*)
-- (udb->base + node->lookup.data);
-+ ((char*)udb->base + node->lookup.data);
- /* we do not care for what the exact radix key is, we want
- * to add all of them and the read routine does not need
- * the radix-key, it has it stored */
- for(i=0; i<a->len; i++) {
- if(a->array[i].node.data) {
- read_zone_recurse(udb, db, dname_region, zone,
-- (struct udb_radnode_d*)(udb->base +
-+ (struct udb_radnode_d*)((char*)udb->base +
- a->array[i].node.data));
- }
- }
-@@ -240,7 +240,7 @@ read_zone_data(udb_base* udb, namedb_type* db, region_type* dname_region,
- if(RADTREE(&dtree)->root.data)
- read_zone_recurse(udb, db, dname_region, zone,
- (struct udb_radnode_d*)
-- (udb->base + RADTREE(&dtree)->root.data));
-+ ((char*)udb->base + RADTREE(&dtree)->root.data));
- udb_ptr_unlink(&dtree, udb);
- }
-
-diff --git a/difffile.c b/difffile.c
-index b3aee0b4..82056ada 100644
---- a/difffile.c
-+++ b/difffile.c
-@@ -1631,7 +1631,7 @@ void* task_new_stat_info(udb_base* udb, udb_ptr* last, struct nsdst* stat,
- p = TASKLIST(&e)->zname;
- memcpy(p, stat, sizeof(*stat));
- udb_ptr_unlink(&e, udb);
-- return p + sizeof(*stat);
-+ return (char*)p + sizeof(*stat);
- }
- #endif /* BIND8_STATS */
-
-@@ -1653,7 +1653,7 @@ task_new_add_zone(udb_base* udb, udb_ptr* last, const char* zone,
- TASKLIST(&e)->yesno = zonestatid;
- p = TASKLIST(&e)->zname;
- memcpy(p, zone, zlen+1);
-- memmove(p+zlen+1, pattern, plen+1);
-+ memmove((char*)p+zlen+1, pattern, plen+1);
- udb_ptr_unlink(&e, udb);
- }
-
-diff --git a/region-allocator.c b/region-allocator.c
-index 638c861b..f53841ad 100644
---- a/region-allocator.c
-+++ b/region-allocator.c
-@@ -272,7 +272,7 @@ region_alloc(region_type *region, size_t size)
- region->total_allocated += size;
- ++region->large_objects;
-
-- return result + sizeof(struct large_elem);
-+ return (char *)result + sizeof(struct large_elem);
- }
-
- if (region->recycle_bin && region->recycle_bin[aligned_size]) {
-@@ -469,7 +469,7 @@ region_recycle(region_type *region, void *block, size_t size)
- region->total_allocated -= size;
- --region->large_objects;
-
-- l = (struct large_elem*)(block-sizeof(struct large_elem));
-+ l = (struct large_elem*)((char*)block-sizeof(struct large_elem));
- if(l->prev)
- l->prev->next = l->next;
- else region->large_list = l->next;
-diff --git a/udb.c b/udb.c
-index 1b41ab91..b02a482b 100644
---- a/udb.c
-+++ b/udb.c
-@@ -192,13 +192,13 @@ udb_base_create_fd(const char* fname, int fd, udb_walk_relptr_func walkfunc,
- }
-
- /* init completion */
-- udb->glob_data = (udb_glob_d*)(udb->base+sizeof(uint64_t));
-+ udb->glob_data = (udb_glob_d*)((char*)udb->base+sizeof(uint64_t));
- r = 0;
- /* cannot be dirty because that is goto fail above */
- if(udb->glob_data->dirty_alloc != udb_dirty_clean)
- r = 1;
- udb->alloc = udb_alloc_create(udb, (udb_alloc_d*)(
-- (void*)udb->glob_data+sizeof(*udb->glob_data)));
-+ (char*)udb->glob_data+sizeof(*udb->glob_data)));
- if(!udb->alloc) {
- log_msg(LOG_ERR, "out of memory");
- udb_base_free(udb);
-@@ -555,10 +555,10 @@ udb_base_remap(udb_base* udb, udb_alloc* alloc, uint64_t nsize)
- /* fix up realpointers in udb and alloc */
- /* but mremap may have been nice and not move the base */
- udb->base = nb;
-- udb->glob_data = (udb_glob_d*)(nb+sizeof(uint64_t));
-+ udb->glob_data = (udb_glob_d*)((char*)nb+sizeof(uint64_t));
- /* use passed alloc pointer because the udb->alloc may not
- * be initialized yet */
-- alloc->disk = (udb_alloc_d*)((void*)udb->glob_data
-+ alloc->disk = (udb_alloc_d*)((char*)udb->glob_data
- +sizeof(*udb->glob_data));
- }
- udb->base_size = nsize;
-@@ -798,7 +798,7 @@ regen_ptrlist(void* base, udb_base* udb, udb_alloc* alloc,
- if(exp == UDB_EXP_XL) {
- assert(at != rb_old); /* should have been freed */
- regen_its_ptrs(base, udb, atp,
-- ((void*)atp)+sizeof(udb_xl_chunk_d),
-+ ((char*)atp)+sizeof(udb_xl_chunk_d),
- sz-sizeof(udb_xl_chunk_d) - sizeof(uint64_t)*2,
- rb_old, rb_new);
- at += sz;
-@@ -807,7 +807,7 @@ regen_ptrlist(void* base, udb_base* udb, udb_alloc* alloc,
- } else { /* data chunk */
- assert(at != rb_old); /* should have been freed */
- regen_its_ptrs(base, udb, atp,
-- ((void*)atp)+sizeof(udb_chunk_d),
-+ ((char*)atp)+sizeof(udb_chunk_d),
- sz-sizeof(udb_chunk_d)-1, rb_old, rb_new);
- at += sz;
- }
-diff --git a/udb.h b/udb.h
-index 8d7ee137..3ee98648 100644
---- a/udb.h
-+++ b/udb.h
-@@ -52,9 +52,9 @@ typedef struct udb_alloc udb_alloc;
- typedef uint64_t udb_void;
-
- /** convert relptr to usable pointer */
--#define UDB_REL(base, relptr) ((base) + (relptr))
-+#define UDB_REL(base, relptr) ((void*)((char*)(base) + (relptr)))
- /** from system pointer to relative pointer */
--#define UDB_SYSTOREL(base, ptr) ((udb_void)((void*)(ptr) - (base)))
-+#define UDB_SYSTOREL(base, ptr) ((udb_void)((char*)(ptr) - (char*)(base)))
-
- /** MAX 2**x exponent of alloced chunks, for 1Mbytes. The smallest
- * chunk is 16bytes (8preamble+8data), so 0-3 is unused. */
-diff --git a/xfrd.c b/xfrd.c
-index bd07d797..82551907 100644
---- a/xfrd.c
-+++ b/xfrd.c
-@@ -2466,7 +2466,7 @@ static void
- xfrd_process_stat_info_task(xfrd_state_type* xfrd, struct task_list_d* task)
- {
- size_t i;
-- stc_type* p = (void*)task->zname + sizeof(struct nsdst);
-+ stc_type* p = (void*)((char*)task->zname + sizeof(struct nsdst));
- stats_add(&xfrd->nsd->st, (struct nsdst*)task->zname);
- for(i=0; i<xfrd->nsd->child_count; i++) {
- xfrd->nsd->children[i].query_count += *p++;
---
-2.24.0
-
diff --git a/pkg/nsd/patch/0004-Avoid-unnecessary-VLA.patch b/pkg/nsd/patch/0004-Avoid-unnecessary-VLA.patch
deleted file mode 100644
index 9be7c002..00000000
--- a/pkg/nsd/patch/0004-Avoid-unnecessary-VLA.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 3dbfc38645c53c2bf9b5f54635a2fa65ddaeab88 Mon Sep 17 00:00:00 2001
-From: Michael Forney <mforney@mforney.org>
-Date: Sun, 16 Jun 2019 23:37:11 -0700
-Subject: [PATCH] Avoid unnecessary VLA
-Upstream: https://github.com/NLnetLabs/nsd/pull/60
-
----
- xfrd-tcp.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/xfrd-tcp.c b/xfrd-tcp.c
-index 1ae5311c..d00c13b7 100644
---- a/xfrd-tcp.c
-+++ b/xfrd-tcp.c
-@@ -215,8 +215,8 @@ pipeline_find(struct xfrd_tcp_set* set, xfrd_zone_type* zone)
- /* smaller buf than a full pipeline with 64kb ID array, only need
- * the front part with the key info, this front part contains the
- * members that the compare function uses. */
-- const size_t keysize = sizeof(struct xfrd_tcp_pipeline) -
-- ID_PIPE_NUM*(sizeof(struct xfrd_zone*) + sizeof(uint16_t));
-+ enum { keysize = sizeof(struct xfrd_tcp_pipeline) -
-+ ID_PIPE_NUM*(sizeof(struct xfrd_zone*) + sizeof(uint16_t)) };
- /* void* type for alignment of the struct,
- * divide the keysize by ptr-size and then add one to round up */
- void* buf[ (keysize / sizeof(void*)) + 1 ];
---
-2.25.0
-