pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/net/ucspi-tcp6 Apply upstream patch to fix incorrect b...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a306d97d95db
branches:  trunk
changeset: 399973:a306d97d95db
user:      schmonz <schmonz%pkgsrc.org@localhost>
date:      Mon Aug 19 22:05:39 2019 +0000

description:
Apply upstream patch to fix incorrect behavior in tcpserver and
tcpclient when an IPv4 address is given as the hostname.
Bump PKGREVISION.

diffstat:

 net/ucspi-tcp6/Makefile                      |   3 +-
 net/ucspi-tcp6/distinfo                      |   4 +-
 net/ucspi-tcp6/patches/patch-src_tcpclient.c |  24 ++++++++++++++
 net/ucspi-tcp6/patches/patch-src_tcpserver.c |  46 ++++++++++++++++++++++++++++
 4 files changed, 75 insertions(+), 2 deletions(-)

diffs (103 lines):

diff -r d7fd7ad98681 -r a306d97d95db net/ucspi-tcp6/Makefile
--- a/net/ucspi-tcp6/Makefile   Mon Aug 19 20:01:52 2019 +0000
+++ b/net/ucspi-tcp6/Makefile   Mon Aug 19 22:05:39 2019 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.17 2019/08/03 10:43:27 schmonz Exp $
+# $NetBSD: Makefile,v 1.18 2019/08/19 22:05:39 schmonz Exp $
 
 DISTNAME=              ucspi-tcp6-1.10.7
+PKGREVISION=           1
 CATEGORIES=            net
 MASTER_SITES=          https://www.fehcom.de/ipnet/ucspi-tcp6/
 EXTRACT_SUFX=          .tgz
diff -r d7fd7ad98681 -r a306d97d95db net/ucspi-tcp6/distinfo
--- a/net/ucspi-tcp6/distinfo   Mon Aug 19 20:01:52 2019 +0000
+++ b/net/ucspi-tcp6/distinfo   Mon Aug 19 22:05:39 2019 +0000
@@ -1,6 +1,8 @@
-$NetBSD: distinfo,v 1.13 2019/08/03 10:43:27 schmonz Exp $
+$NetBSD: distinfo,v 1.14 2019/08/19 22:05:39 schmonz Exp $
 
 SHA1 (ucspi-tcp6-1.10.7.tgz) = 82d06361e8b69ca4a6df8106876c2d9041906d2a
 RMD160 (ucspi-tcp6-1.10.7.tgz) = 70fe5dd1e1aded55d3f1d58771eeef2fc32ceda5
 SHA512 (ucspi-tcp6-1.10.7.tgz) = 3ceb78d2a761156f7c0ee2b9ad36f728bcb78cad588bcd5f29e305a26b25fd1fc424b970dd0abfe4769680b756cfc4f60b1c60204e0eacce43d5ccc5f90fb85d
 Size (ucspi-tcp6-1.10.7.tgz) = 51200 bytes
+SHA1 (patch-src_tcpclient.c) = 12d4a7f4ae2b50b1c2357b1960306ad3296103da
+SHA1 (patch-src_tcpserver.c) = 922089930e9c05e6b8aecc22c1912fc212bd7ab3
diff -r d7fd7ad98681 -r a306d97d95db net/ucspi-tcp6/patches/patch-src_tcpclient.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/ucspi-tcp6/patches/patch-src_tcpclient.c      Mon Aug 19 22:05:39 2019 +0000
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_tcpclient.c,v 1.1 2019/08/19 22:05:39 schmonz Exp $
+
+Apply upstream patch to fix incorrect behavior in tcpclient when an IPv4
+address is given as the hostname.
+
+--- src/tcpclient.c.orig       2019-07-19 17:32:34.000000000 +0000
++++ src/tcpclient.c
+@@ -133,12 +133,10 @@ int main(int argc,char **argv)
+ 
+   if (!*++argv) usage();
+ 
+-
+-  if (ipv4socket) {
+-     if (ip4_scan(hostname,ipremote)) {
+-       if (!stralloc_copyb(&addresses,(char *)V4mappedprefix,12)) nomem();
+-       byte_copy(addresses.s + 12,4,ipremote);
+-     }
++  if (ip4_scan(hostname,ipremote + 12)) {
++    if (!stralloc_copys(&addresses,"")) nomem();
++    byte_copy(addresses.s,12,V4mappedprefix);
++    byte_copy(addresses.s + 12,4,ipremote + 12);
+   } else if (ip6_scan(hostname,ipremote))
+      if (!stralloc_copyb(&addresses,ipremote,16)) nomem();
+ 
diff -r d7fd7ad98681 -r a306d97d95db net/ucspi-tcp6/patches/patch-src_tcpserver.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/ucspi-tcp6/patches/patch-src_tcpserver.c      Mon Aug 19 22:05:39 2019 +0000
@@ -0,0 +1,46 @@
+$NetBSD: patch-src_tcpserver.c,v 1.1 2019/08/19 22:05:39 schmonz Exp $
+
+Apply upstream patch to fix incorrect behavior in tcpserver when an IPv4
+address is given as the hostname.
+
+--- src/tcpserver.c.orig       2019-07-14 10:16:33.000000000 +0000
++++ src/tcpserver.c
+@@ -137,8 +137,9 @@ void doit(int t)
+ {
+   uint32 netif;
+   int j;
+-
+-  ipv4socket = ip6_isv4mapped(remoteip);
++ 
++  if (!ipv4socket) 
++    ipv4socket = ip6_isv4mapped(remoteip);
+ 
+   if (socket_local(t,localip,&localport,&netif) == -1)
+     logmsg(WHO,111,FATAL,"unable to get local address");
+@@ -392,10 +393,11 @@ int main(int argc,char **argv)
+ 
+   /* Name qualification */
+ 
+-  if (ip4_scan(hostname,localip)) {
++  if (ip4_scan(hostname,localip + 12)) {
+     if (!stralloc_copys(&addresses,"")) drop_nomem();
+     byte_copy(addresses.s,12,V4mappedprefix);
+-    byte_copy(addresses.s + 12,4,localip);
++    byte_copy(addresses.s + 12,4,localip + 12);
++    ipv4socket = 1;
+   } else if (ip6_scan(hostname,localip))
+     if (!stralloc_copyb(&addresses,localip,16)) drop_nomem();
+ 
+@@ -403,10 +405,9 @@ int main(int argc,char **argv)
+     if (!stralloc_copys(&tmp,hostname)) drop_nomem();
+     if (!dns_ip6_qualify(&addresses,&fqdn,&tmp))
+       logmsg(WHO,111,FATAL,B("temporarily unable to figure out IP address for: ",(char *)hostname));
+-    if (addresses.len < 16)
+-      logmsg(WHO,111,FATAL,B("no IP address for: ",(char *)hostname));
+   }
+-  byte_copy(localip,16,addresses.s);
++  if (addresses.len < 16)
++    logmsg(WHO,111,FATAL,B("no IP address for: ",(char *)hostname));
+ 
+   s = socket_tcp();
+   if (s == -1)



Home | Main Index | Thread Index | Old Index