git: cd8a6ef59252 - main - net/tinyfugue: fix IPv6 on 64bit
Dirk Meyer
dinoex at FreeBSD.org
Mon Sep 20 14:08:09 UTC 2021
The branch main has been updated by dinoex:
URL: https://cgit.FreeBSD.org/ports/commit/?id=cd8a6ef59252f3c2b2ffb30fe83d49942efc8122
commit cd8a6ef59252f3c2b2ffb30fe83d49942efc8122
Author: Dirk Meyer <dinoex at FreeBSD.org>
AuthorDate: 2021-09-20 14:07:19 +0000
Commit: Dirk Meyer <dinoex at FreeBSD.org>
CommitDate: 2021-09-20 14:08:04 +0000
net/tinyfugue: fix IPv6 on 64bit
---
net/tinyfugue/Makefile | 2 +-
net/tinyfugue/files/patch-output.c | 10 +++++++++
net/tinyfugue/files/patch-socket.c | 45 ++++++++++++++++++++++++++++++++++++++
3 files changed, 56 insertions(+), 1 deletion(-)
diff --git a/net/tinyfugue/Makefile b/net/tinyfugue/Makefile
index eeb3126a96b4..e081340fc9ae 100644
--- a/net/tinyfugue/Makefile
+++ b/net/tinyfugue/Makefile
@@ -2,7 +2,7 @@
PORTNAME= tf
PORTVERSION= 5.0b8
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= net games
MASTER_SITES= SF/tinyfugue/tinyfugue/5.0%20beta%208
DISTNAME= ${PORTNAME}-${PORTVERSION:S/.//}
diff --git a/net/tinyfugue/files/patch-output.c b/net/tinyfugue/files/patch-output.c
new file mode 100644
index 000000000000..29cd3c6b45e2
--- /dev/null
+++ b/net/tinyfugue/files/patch-output.c
@@ -0,0 +1,10 @@
+--- src/output.c.orig 2007-01-14 00:44:19 UTC
++++ src/output.c
+@@ -2270,6 +2270,7 @@ static void ioutall(int kpos)
+ iendx = -kpos + 1;
+ kpos = 0;
+ }
++ if (keybuf->data == 0) return;
+ if (sockecho())
+ ioutputs(keybuf->data + kpos, keybuf->len - kpos);
+ }
diff --git a/net/tinyfugue/files/patch-socket.c b/net/tinyfugue/files/patch-socket.c
new file mode 100644
index 000000000000..3fb940efdbfa
--- /dev/null
+++ b/net/tinyfugue/files/patch-socket.c
@@ -0,0 +1,45 @@
+--- src/socket.c.orig 2007-01-13 23:12:39 UTC
++++ src/socket.c
+@@ -494,6 +494,8 @@ do { \
+ do_hook(H_DISCONNECT, "%% Connection to %s closed: %s: %s", "%s %s: %s", \
+ where, what, why)
+
++#define ROUND_UP_LENGTH(len) ((len + 7) & -8)
++
+ #if HAVE_SSL
+ static void ssl_err(const char *str)
+ {
+@@ -1478,8 +1480,8 @@ static int openconn(Sock *sock)
+ for (ai = xsock->addrs; ai; ai = ai->ai_next) {
+ ai->ai_addr = (struct sockaddr*)((char*)ai + sizeof(*ai));
+ if (ai->ai_next != 0) {
+- ai->ai_next =
+- (struct addrinfo*)((char*)ai->ai_addr + ai->ai_addrlen);
++ ai->ai_next =
++ (struct addrinfo*)((char*)ai->ai_addr + ROUND_UP_LENGTH(ai->ai_addrlen));
+ }
+ }
+ xsock->addr = xsock->addrs;
+@@ -1783,13 +1785,21 @@ static void waitforhostname(int fd, const char *name,
+ iov[0].iov_len = sizeof(hdr);
+ niov = 1;
+ for (ai = res; ai && niov < NIOV; ai = ai->ai_next) {
+- hdr.size += sizeof(*ai) + ai->ai_addrlen;
++ static const char zeros[ 8 ] = { 0, 0, 0, 0, 0, 0, 0, 0 };
++ size_t padded = ROUND_UP_LENGTH(ai->ai_addrlen);
++ hdr.size += sizeof(*ai) + padded;
+ iov[niov].iov_base = (char*)ai;
+ iov[niov].iov_len = sizeof(*ai);
+ niov++;
+ iov[niov].iov_base = (char*)ai->ai_addr;
+ iov[niov].iov_len = ai->ai_addrlen;
+ niov++;
++ if (padded != ai->ai_addrlen) {
++ /* padding */
++ iov[niov].iov_base = (char*)zeros;
++ iov[niov].iov_len = padded - ai->ai_addrlen;
++ niov++;
++ }
+ }
+ writev(fd, iov, niov);
+ if (res) freeaddrinfo(res);
More information about the dev-commits-ports-all
mailing list