pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/net/knot



Module Name:    pkgsrc
Committed By:   drixter
Date:           Fri Sep 11 12:53:14 UTC 2026

Modified Files:
        pkgsrc/net/knot: distinfo
Added Files:
        pkgsrc/net/knot/patches: patch-src_contrib_time.c
            patch-src_contrib_ucw_mempool.c patch-tests_contrib_test_atomic.c
            patch-tests_knot_test__semantic__check.in
            patch-tests_libknot_test_cookies.c

Log Message:
knot: Patch from upstream to work on SmartOS #980


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 pkgsrc/net/knot/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/net/knot/patches/patch-src_contrib_time.c \
    pkgsrc/net/knot/patches/patch-src_contrib_ucw_mempool.c \
    pkgsrc/net/knot/patches/patch-tests_contrib_test_atomic.c \
    pkgsrc/net/knot/patches/patch-tests_knot_test__semantic__check.in \
    pkgsrc/net/knot/patches/patch-tests_libknot_test_cookies.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/net/knot/distinfo
diff -u pkgsrc/net/knot/distinfo:1.59 pkgsrc/net/knot/distinfo:1.60
--- pkgsrc/net/knot/distinfo:1.59       Wed Sep  9 14:25:20 2026
+++ pkgsrc/net/knot/distinfo    Fri Sep 11 12:53:13 2026
@@ -1,6 +1,11 @@
-$NetBSD: distinfo,v 1.59 2026/09/09 14:25:20 drixter Exp $
+$NetBSD: distinfo,v 1.60 2026/09/11 12:53:13 drixter Exp $
 
 BLAKE2s (knot-3.6.0.tar.xz) = 79dabdb7837e77fde56795cb6d959de1b9dc292c26786ed511a768001a3356c0
 SHA512 (knot-3.6.0.tar.xz) = 83369a94ce7f35f41b08d599844e4c9586c29ba8efcf841e90560734b81df72054ddd62df609b84149944a36672bb71219c66e6e0c8ee7e41d5c421fc256e64a
 Size (knot-3.6.0.tar.xz) = 1852000 bytes
 SHA1 (patch-samples_Makefile.in) = 499b8742dbd948e489b01d512bc7a8d8e4fe2e7b
+SHA1 (patch-src_contrib_time.c) = 67bd79053522b5142d622721377e791134901729
+SHA1 (patch-src_contrib_ucw_mempool.c) = 68e9d60757edc9fb58f323884ecc62ea0f024f36
+SHA1 (patch-tests_contrib_test_atomic.c) = 019cd4eab859b61afd8b839eea64f246bce8adaf
+SHA1 (patch-tests_knot_test__semantic__check.in) = bb55e07176e194bc34ed2eb957040e5d0531ed12
+SHA1 (patch-tests_libknot_test_cookies.c) = 07fca48cbd3948ba607b4ccdd852ac5ee2d1e20e

Added files:

Index: pkgsrc/net/knot/patches/patch-src_contrib_time.c
diff -u /dev/null pkgsrc/net/knot/patches/patch-src_contrib_time.c:1.1
--- /dev/null   Fri Sep 11 12:53:14 2026
+++ pkgsrc/net/knot/patches/patch-src_contrib_time.c    Fri Sep 11 12:53:13 2026
@@ -0,0 +1,65 @@
+$NetBSD: patch-src_contrib_time.c,v 1.1 2026/09/11 12:53:13 drixter Exp $
+
+Patch from upstream to work on SmartOS #980
+
+--- src/contrib/time.c.orig    2026-09-10 16:32:13.079142881 +0000
++++ src/contrib/time.c
+@@ -15,6 +15,19 @@
+ #include "contrib/ctype.h"
+ #include "contrib/string.h"
+ 
++
++static long get_gmtoff(const struct tm *tm)
++{
++#ifdef __sun
++      return (tm->tm_isdst > 0) ? -altzone : -timezone;
++#else
++      return tm->tm_gmtoff;
++#endif
++}
++
++
++
++
+ struct timespec time_now(void)
+ {
+       struct timespec result = { 0 };
+@@ -422,11 +435,17 @@ int knot_time_print(knot_time_print_t fo
+                       return -1;
+               }
+               tt = (time_t)time;
+-              ret = (localtime_r(&tt, &lt) == NULL ? -1 :
+-                     snprintf_check(dst, dst_len, "%04d-%02d-%02dT%02d:%02d:%02d%+03ld:%02d",
+-                                    lt.tm_year + 1900, lt.tm_mon + 1, lt.tm_mday,
+-                                    lt.tm_hour, lt.tm_min, lt.tm_sec,
+-                                    lt.tm_gmtoff / 3600, abs((int)(lt.tm_gmtoff / 60)) % 60));
++
++              ret = localtime_r(&tt, &lt) == NULL ? -1 : 0;
++              if (ret >= 0) {
++                      int gmtoff_min = abs((int)(get_gmtoff(&lt) / 60)) % 60;
++                      ret = snprintf_check(dst, dst_len, "%04d-%02d-%02dT%02d:%02d:%02d%+03ld:%02d",
++                                           lt.tm_year + 1900, lt.tm_mon + 1, lt.tm_mday,
++                                           lt.tm_hour, lt.tm_min, lt.tm_sec,
++                                           get_gmtoff(&lt) / 3600, gmtoff_min);
++              }
++
++
+               return (ret > 0 ? 0 : -1);
+       case TIME_PRINT_RELSEC:
+               ret = snprintf(dst, dst_len, "%+"KNOT_TIMEDIFF_PRINTF,
+@@ -476,12 +495,12 @@ int knot_time_print_ex(knot_time_print_t
+               tt = (time_t)time;
+               ret = localtime_r(&tt, &lt) == NULL ? -1 : 0;
+               if (ret >= 0) {
+-                      int gmtoff_min = abs((int)(lt.tm_gmtoff / 60)) % 60;
++                      int gmtoff_min = abs((int)(get_gmtoff(&lt) / 60)) % 60;
+                       ret = snprintf_check(dst, dst_len, "%04d-%02d-%02dT%02d:%02d:%02d.%03ld%+03ld:%02d%s",
+                                            lt.tm_year + 1900, lt.tm_mon + 1, lt.tm_mday,
+                                            lt.tm_hour, lt.tm_min, lt.tm_sec, millis,
+-                                           lt.tm_gmtoff / 3600, gmtoff_min, suffix);
+-              }
++                                            get_gmtoff(&lt) / 3600, gmtoff_min, suffix);
++              }
+               return (ret > 0 ? 0 : -1);
+       case TIME_PRINT_RELSEC:
+               ;
Index: pkgsrc/net/knot/patches/patch-src_contrib_ucw_mempool.c
diff -u /dev/null pkgsrc/net/knot/patches/patch-src_contrib_ucw_mempool.c:1.1
--- /dev/null   Fri Sep 11 12:53:14 2026
+++ pkgsrc/net/knot/patches/patch-src_contrib_ucw_mempool.c     Fri Sep 11 12:53:13 2026
@@ -0,0 +1,23 @@
+$NetBSD: patch-src_contrib_ucw_mempool.c,v 1.1 2026/09/11 12:53:13 drixter Exp $
+
+Patch from upstream to work on SmartOS #980
+
+--- src/contrib/ucw/mempool.c.orig     2026-09-10 17:00:32.049321056 +0000
++++ src/contrib/ucw/mempool.c
+@@ -17,6 +17,7 @@
+ #include <assert.h>
+ #include "contrib/macros.h"
+ #include "contrib/memcheck.h"
++#include "contrib/string.h"
+ #include "contrib/ucw/mempool.h"
+ 
+ #pragma GCC diagnostic ignored "-Wpointer-arith"
+@@ -246,7 +247,7 @@ mp_stats_chain(struct mempool *pool, str
+ void
+ mp_stats(struct mempool *pool, struct mempool_stats *stats)
+ {
+-      bzero(stats, sizeof(*stats));
++      memzero(stats, sizeof(*stats));
+       mp_stats_chain(pool, pool->state.last[0], stats, 0);
+       mp_stats_chain(pool, pool->state.last[1], stats, 1);
+       mp_stats_chain(pool, pool->unused, stats, 2);
Index: pkgsrc/net/knot/patches/patch-tests_contrib_test_atomic.c
diff -u /dev/null pkgsrc/net/knot/patches/patch-tests_contrib_test_atomic.c:1.1
--- /dev/null   Fri Sep 11 12:53:14 2026
+++ pkgsrc/net/knot/patches/patch-tests_contrib_test_atomic.c   Fri Sep 11 12:53:14 2026
@@ -0,0 +1,28 @@
+$NetBSD: patch-tests_contrib_test_atomic.c,v 1.1 2026/09/11 12:53:14 drixter Exp $
+
+Patch from upstream to work on SmartOS #980
+
+--- tests/contrib/test_atomic.c.orig   2026-09-10 17:48:19.686990159 +0000
++++ tests/contrib/test_atomic.c
+@@ -6,6 +6,7 @@
+ #include <pthread.h>
+ #include <signal.h>
+ #include <tap/basic.h>
++#include <stdint.h>
+ 
+ #include "contrib/atomic.h"
+ #include "knot/server/dthreads.h"
+@@ -49,11 +50,10 @@ static int thread_add(struct dthread *th
+ 
+ static int thread_set(struct dthread *thread)
+ {
+-      u_int64_t val = (dt_get_id(thread) % 2) ? UPPER : LOWER;
+-
++      uint64_t val = (dt_get_id(thread) % 2) ? UPPER : LOWER;
+       for (int i = 0; i < CYCLES2; i++) {
+               ATOMIC_SET(atomic_var, val);
+-              volatile u_int64_t read = ATOMIC_GET(atomic_var);
++              volatile uint64_t read = ATOMIC_GET(atomic_var);
+               if (read != UPPER && read != LOWER) {
+                       // Non-atomic counter, won't be accurate!
+                       // However, it's sufficient for fault detection.
Index: pkgsrc/net/knot/patches/patch-tests_knot_test__semantic__check.in
diff -u /dev/null pkgsrc/net/knot/patches/patch-tests_knot_test__semantic__check.in:1.1
--- /dev/null   Fri Sep 11 12:53:14 2026
+++ pkgsrc/net/knot/patches/patch-tests_knot_test__semantic__check.in   Fri Sep 11 12:53:14 2026
@@ -0,0 +1,47 @@
+$NetBSD: patch-tests_knot_test__semantic__check.in,v 1.1 2026/09/11 12:53:14 drixter Exp $
+
+Patch from upstream to work on SmartOS #980
+
+--- tests/knot/test_semantic_check.in.orig     2026-09-11 07:05:07.900805215 +0000
++++ tests/knot/test_semantic_check.in
+@@ -14,12 +14,12 @@ LOG="$TMPDIR/log"
+ # Params: zonefile fatal_error expected_erros_count semcheck_err_msg [AUTO]
+ expect_error()
+ {
+-      local zonefile="$1"
+-      local fatals_exp="$2"
+-      local errors_exp="$3"
+-      local msg="$4"
+-      local auto="$5"
+-      local origin=""
++      zonefile="$1"
++      fatals_exp="$2"
++      errors_exp="$3"
++      msg="$4"
++      auto="$5"
++      origin=""
+ 
+       if [ ! -r "$DATA/$zonefile" ]; then
+               skip_block 4 "missing zone file for test"
+@@ -46,9 +46,9 @@ expect_error()
+ #param zonefile [AUTO]
+ test_correct()
+ {
+-      local zonefile="$1"
+-      local auto="$2"
+-      local origin=""
++      zonefile="$1"
++      auto="$2"
++      origin=""
+ 
+       if [ "$auto" != "AUTO" ]; then
+               origin="-o example.com"
+@@ -61,7 +61,7 @@ test_correct()
+ #param zonefile
+ test_correct_no_dnssec()
+ {
+-      local zonefile="$1"
++      zonefile="$1"
+ 
+       $KZONECHECK -o example.com -d off "$DATA/$zonefile" > /dev/null 2>&1
+       ok "$zonefile - correct zone, without error" test $? -eq 0
Index: pkgsrc/net/knot/patches/patch-tests_libknot_test_cookies.c
diff -u /dev/null pkgsrc/net/knot/patches/patch-tests_libknot_test_cookies.c:1.1
--- /dev/null   Fri Sep 11 12:53:14 2026
+++ pkgsrc/net/knot/patches/patch-tests_libknot_test_cookies.c  Fri Sep 11 12:53:14 2026
@@ -0,0 +1,34 @@
+$NetBSD: patch-tests_libknot_test_cookies.c,v 1.1 2026/09/11 12:53:14 drixter Exp $
+
+Patch from upstream to work on SmartOS #980
+
+--- tests/libknot/test_cookies.c.orig  2026-09-10 18:04:46.963249178 +0000
++++ tests/libknot/test_cookies.c
+@@ -14,11 +14,11 @@
+ #include "contrib/sockaddr.h"
+ 
+ static knot_edns_cookie_t client_generate(
+-      struct sockaddr_storage *s_addr, const uint8_t *c_secret,
++      struct sockaddr_storage *srv_addr, const uint8_t *c_secret,
+       const char *msg, int code, const char *ref)
+ {
+       knot_edns_cookie_params_t params = {
+-              .server_addr = s_addr,
++              .server_addr = srv_addr,
+       };
+       memcpy(params.secret, c_secret, sizeof(params.secret));
+ 
+@@ -54,11 +54,11 @@ static knot_edns_cookie_t server_generat
+ }
+ 
+ static void client_check(
+-      struct sockaddr_storage *s_addr, const uint8_t *secret,
++      struct sockaddr_storage *srv_addr, const uint8_t *secret,
+       knot_edns_cookie_t *cc, const char *msg, int code)
+ {
+       knot_edns_cookie_params_t params = {
+-              .server_addr = s_addr,
++              .server_addr = srv_addr,
+       };
+       memcpy(params.secret, secret, sizeof(params.secret));
+ 



Home | Main Index | Thread Index | Old Index