pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/net/trickle
Module Name: pkgsrc
Committed By: wiz
Date: Sat Sep 12 15:04:23 UTC 2026
Modified Files:
pkgsrc/net/trickle: Makefile distinfo
Added Files:
pkgsrc/net/trickle/patches: patch-bwstat.c patch-trickle-overload.c
Removed Files:
pkgsrc/net/trickle/patches: patch-aa
Log Message:
trickle: update to 1.07.
Changes not found.
Fix build & use on NetBSD.
>From Showta Ishizaki in PR 60712 using a patch from RVP.
While here:
Fix build with gcc 14.
Update HOMEPAGE.
To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 pkgsrc/net/trickle/Makefile
cvs rdiff -u -r1.8 -r1.9 pkgsrc/net/trickle/distinfo
cvs rdiff -u -r1.3 -r0 pkgsrc/net/trickle/patches/patch-aa
cvs rdiff -u -r0 -r1.1 pkgsrc/net/trickle/patches/patch-bwstat.c \
pkgsrc/net/trickle/patches/patch-trickle-overload.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/trickle/Makefile
diff -u pkgsrc/net/trickle/Makefile:1.31 pkgsrc/net/trickle/Makefile:1.32
--- pkgsrc/net/trickle/Makefile:1.31 Tue Oct 24 22:10:36 2023
+++ pkgsrc/net/trickle/Makefile Sat Sep 12 15:04:23 2026
@@ -1,14 +1,13 @@
-# $NetBSD: Makefile,v 1.31 2023/10/24 22:10:36 wiz Exp $
-#
+# $NetBSD: Makefile,v 1.32 2026/09/12 15:04:23 wiz Exp $
-DISTNAME= trickle-1.06
-PKGREVISION= 17
+DISTNAME= trickle-1.07
CATEGORIES= net
MASTER_SITES= https://monkey.org/~marius/trickle/
MAINTAINER= pkgsrc-users%NetBSD.org@localhost
-HOMEPAGE= https://monkey.org/~marius/trickle/
+HOMEPAGE= https://github.com/mariusae/trickle
COMMENT= Portable lightweight userspace bandwidth shaper
+LICENSE= modified-bsd
USE_LIBTOOL= yes
GNU_CONFIGURE= yes
@@ -27,5 +26,8 @@ INSTALLATION_DIRS+= ${EGDIR}
pre-install:
${INSTALL_DATA} ${FILESDIR}/trickled.conf ${DESTDIR}${EGDIR}
+CFLAGS+= -Wno-implicit-function-declaration
+CFLAGS+= -Wno-incompatible-pointer-types
+
.include "../../devel/libevent/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/net/trickle/distinfo
diff -u pkgsrc/net/trickle/distinfo:1.8 pkgsrc/net/trickle/distinfo:1.9
--- pkgsrc/net/trickle/distinfo:1.8 Tue Oct 26 11:07:04 2021
+++ pkgsrc/net/trickle/distinfo Sat Sep 12 15:04:23 2026
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.8 2021/10/26 11:07:04 nia Exp $
+$NetBSD: distinfo,v 1.9 2026/09/12 15:04:23 wiz Exp $
-BLAKE2s (trickle-1.06.tar.gz) = 08bbae92e27811ec1d5e311cb9aa275910d125e45dbfed9dd28442807ee42a49
-SHA512 (trickle-1.06.tar.gz) = 3c0e67d41943acc4062539d82e0f43467d7615a11d5fbf5bbc6de1d379946ad7a19a30c25d001cdef7b60b49b47e44506dbac0a33bf07be824a81e191dc9718f
-Size (trickle-1.06.tar.gz) = 166044 bytes
+BLAKE2s (trickle-1.07.tar.gz) = 8f81357d86379678af87334aaed2db32e594717d7eb4e819c81c25c60167fb69
+SHA512 (trickle-1.07.tar.gz) = 08ede3230df849189b6c47e4cbd5be1f3b8e91bd7254219201c00f9ab44cf4c69055a0ca490f55877a28cb5d46554a80cb865390c27b986171300875bcd69824
+Size (trickle-1.07.tar.gz) = 308863 bytes
SHA1 (patch-Makefile.in) = 887435f511f59884ce913001f929b77dc93921fc
-SHA1 (patch-aa) = 8020f0958c357ce886a1565c8db6b0b8abd874f5
+SHA1 (patch-bwstat.c) = 8718635338459d61d1c3ccd12f749ea6d3d205b6
+SHA1 (patch-trickle-overload.c) = b9200719970df0f63d1bc02d604a485f54be4bd3
Added files:
Index: pkgsrc/net/trickle/patches/patch-bwstat.c
diff -u /dev/null pkgsrc/net/trickle/patches/patch-bwstat.c:1.1
--- /dev/null Sat Sep 12 15:04:23 2026
+++ pkgsrc/net/trickle/patches/patch-bwstat.c Sat Sep 12 15:04:23 2026
@@ -0,0 +1,37 @@
+$NetBSD: patch-bwstat.c,v 1.1 2026/09/12 15:04:23 wiz Exp $
+
+bwstat_getdelay() does its pool/npts pool-sharing arithmetic in
+unsigned ints, which underflow to huge values; make ncli, pool and
+xent signed and stop at xent <= 0. Also initialise bs->pts in
+bwstat_alloc(). Part of a patch posted to netbsd-users on 2025-02-20
+that fixes the Memory fault crash on NetBSD.
+
+--- bwstat.c.orig
++++ bwstat.c
+@@ -69,6 +69,7 @@
+ if ((bs = calloc(1, sizeof(*bs))) == NULL)
+ return (NULL);
+
++ bs->pts = 1;
+ TAILQ_INSERT_TAIL(&statq, bs, next);
+
+ return (bs);
+@@ -143,7 +144,8 @@
+ struct timeval *
+ bwstat_getdelay(struct bwstat *bs, size_t *len, uint lim, short which)
+ {
+- uint rate = 0, ncli = 0, npts = 0, pool = 0, ent, xent;
++ uint rate = 0, npts = 0, ent;
++ int ncli = 0, pool = 0, xent;
+ double delay;
+ static struct timeval tv;
+ struct bwstathead poolq;
+@@ -201,7 +203,7 @@
+ if (ncli > 0) {
+ xent = pool / npts;
+
+- if (xent == 0)
++ if (xent <= 0)
+ break;
+
+ TAILQ_FOREACH(xbs, &poolq, qnext)
Index: pkgsrc/net/trickle/patches/patch-trickle-overload.c
diff -u /dev/null pkgsrc/net/trickle/patches/patch-trickle-overload.c:1.1
--- /dev/null Sat Sep 12 15:04:23 2026
+++ pkgsrc/net/trickle/patches/patch-trickle-overload.c Sat Sep 12 15:04:23 2026
@@ -0,0 +1,164 @@
+$NetBSD: patch-trickle-overload.c,v 1.1 2026/09/12 15:04:23 wiz Exp $
+
+On NetBSD the socket() and select() interceptors resolved the wrong
+libc symbol: the wrappers are exported as __socket30 / __select50
+(the headers rename them), but GETADDR looked up the plain names.
+Resolve __socket30 / __select50 on NetBSD, mask SOCK_NONBLOCK and
+SOCK_CLOEXEC out of the socket type before the AF_INET/SOCK_STREAM
+test, add NetBSD to the poll() platform conditionals, and pass the
+timeval by pointer in select_shift(). Part of a patch posted to
+netbsd-users on 2025-02-20 that fixes the Memory fault crash on NetBSD.
+
+--- trickle-overload.c.orig
++++ trickle-overload.c
+@@ -196,7 +196,12 @@
+
+ GETADDR(write);
+
++#ifdef __NetBSD__
++ if ((libc_socket = dlsym(dh, "__socket30")) == NULL)
++ errx(0, "[trickle] Failed to get __socket30() address");
++#else
+ GETADDR(socket);
++#endif
+ /* GETADDR(setsockopt); */
+ GETADDR(close);
+
+@@ -213,7 +218,12 @@
+ #endif /* !__FreeBSD__ */
+ GETADDR(sendto);
+
++#ifdef __NetBSD__
++ if ((libc_select = dlsym(dh, "__select50")) == NULL)
++ errx(0, "[trickle] Failed to get __select50() address");
++#else
+ GETADDR(select);
++#endif
+ // GETADDR(poll);
+
+ GETADDR(dup);
+@@ -302,6 +312,13 @@
+ domain, type, protocol, sock);
+ #endif /* DEBUG */
+
++#ifdef SOCK_NONBLOCK
++ type &= ~SOCK_NONBLOCK;
++#endif
++#ifdef SOCK_CLOEXEC
++ type &= ~SOCK_CLOEXEC;
++#endif
++
+ if (sock != -1 && domain == AF_INET && type == SOCK_STREAM) {
+ if ((sd = calloc(1, sizeof(*sd))) == NULL)
+ return (-1);
+@@ -311,7 +328,6 @@
+ }
+
+ /* All sockets are equals. */
+- sd->stat->pts = 1;
+ sd->stat->lsmooth = lsmooth;
+ sd->stat->tsmooth = tsmooth;
+ sd->sock = sock;
+@@ -393,18 +409,14 @@
+ }
+
+ static struct delay *
+-select_shift(struct delayhead *dhead, struct timeval *inittv,
++select_shift(struct delayhead *dhead, struct timeval *difftv,
+ struct timeval **delaytv)
+ {
+- struct timeval curtv, difftv;
+ struct delay *d;
+ struct sockdesc *sd;
+
+- gettimeofday(&curtv, NULL);
+- timersub(&curtv, inittv, &difftv);
+-
+ TAILQ_FOREACH(d, dhead, next) {
+- if (timercmp(&d->delaytv, &difftv, >))
++ if (timercmp(&d->delaytv, difftv, >))
+ break;
+ sd = d->sd;
+
+@@ -413,7 +425,7 @@
+ }
+
+ if (d != NULL)
+- timersub(&d->delaytv, &difftv, *delaytv);
++ timersub(&d->delaytv, difftv, *delaytv);
+ else
+ *delaytv = NULL;
+
+@@ -431,8 +443,8 @@
+ {
+ struct sockdesc *sd;
+ fd_set *fdsets[] = { wfds, rfds }, *fds;
+- struct timeval *delaytv, *selecttv = NULL, *timeout = NULL, _timeout,
+- inittv, curtv, difftv;
++ struct timeval *delaytv, _delaytv, *selecttv = NULL, *timeout = NULL,
++ _timeout, inittv, curtv, difftv;
+ short which;
+ struct delayhead dhead;
+ struct delay *d, *_d;
+@@ -462,15 +474,18 @@
+ FD_ISSET(sd->sock, fds) &&
+ select_delay(&dhead, sd, which)) {
+ FD_CLR(sd->sock, fds);
+- nfds--;
+ }
+
+ gettimeofday(&inittv, NULL);
+ curtv = inittv;
+ d = TAILQ_FIRST(&dhead);
+- delaytv = d != NULL ? &d->delaytv : NULL;
++ if (d != NULL) {
++ _delaytv = d->delaytv;
++ delaytv = &_delaytv;
++ } else
++ delaytv = NULL;
++ timersub(&curtv, &inittv, &difftv);
+ again:
+- timersub(&inittv, &curtv, &difftv);
+ selecttv = NULL;
+
+ if (delaytv != NULL)
+@@ -498,15 +513,15 @@
+ #endif /* DEBUG */
+
+ if (ret == 0 && delaytv != NULL && selecttv == delaytv) {
+- _d = select_shift(&dhead, &inittv, &delaytv);
++ gettimeofday(&curtv, NULL);
++ timersub(&curtv, &inittv, &difftv);
++ _d = select_shift(&dhead, &difftv, &delaytv);
+ while ((d = TAILQ_FIRST(&dhead)) != _d) {
+ FD_SET(d->sd->sock, fdsets[d->which]);
+- nfds++;
+ TAILQ_REMOVE(&dhead, d, next);
+ free(d);
+ }
+
+- gettimeofday(&curtv, NULL);
+ goto again;
+ }
+
+@@ -522,10 +537,10 @@
+ #define POLL_WRMASK (POLLOUT | POLLWRNORM | POLLWRBAND)
+ #define POLL_RDMASK (POLLIN | /* POLLNORM | */ POLLPRI | POLLRDNORM | POLLRDBAND)
+
+-#if defined(__linux__) || (defined(__svr4__) && defined(__sun__)) || defined(__OpenBSD__)
++#if defined(__linux__) || (defined(__svr4__) && defined(__sun__)) || defined(__OpenBSD__) || defined(__NetBSD__)
+ int
+ poll(struct pollfd *fds, nfds_t nfds, int __timeout)
+-#elif defined(__FreeBSD__)
++#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__)
+ int
+ poll(struct pollfd *fds, unsigned int nfds, int __timeout)
+ #else
+@@ -994,7 +1009,6 @@
+ }
+
+ sd->sock = ret;
+- sd->stat->pts = 1;
+ sd->stat->lsmooth = lsmooth;
+ sd->stat->tsmooth = tsmooth;
+ TAILQ_INSERT_TAIL(&sdhead, sd, next);
Home |
Main Index |
Thread Index |
Old Index