pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/net/tcpexec tcpexec: fix build w/o SO_REUSEPORT



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c23faa2f0571
branches:  trunk
changeset: 377951:c23faa2f0571
user:      tnn <tnn%pkgsrc.org@localhost>
date:      Mon Apr 25 15:33:58 2022 +0000

description:
tcpexec: fix build w/o SO_REUSEPORT

diffstat:

 net/tcpexec/Makefile                |   4 +++-
 net/tcpexec/distinfo                |   4 ++--
 net/tcpexec/patches/patch-tcpexec.c |  15 +++++++++++++--
 3 files changed, 18 insertions(+), 5 deletions(-)

diffs (58 lines):

diff -r 798e52adf21a -r c23faa2f0571 net/tcpexec/Makefile
--- a/net/tcpexec/Makefile      Mon Apr 25 15:24:31 2022 +0000
+++ b/net/tcpexec/Makefile      Mon Apr 25 15:33:58 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2021/11/15 11:36:58 schmonz Exp $
+# $NetBSD: Makefile,v 1.2 2022/04/25 15:33:58 tnn Exp $
 
 GITHUB_PROJECT=                tcpexec
 GITHUB_TAG=            7e02e755aca4cb377910b729e43de8e3fb48eece
@@ -18,6 +18,8 @@
 
 INSTALLATION_DIRS=     bin share/doc/${PKGBASE}
 
+LDFLAGS.SunOS+=                -lsocket -lnsl
+
 do-install:
        ${INSTALL_PROGRAM} ${WRKSRC}/tcpexec ${DESTDIR}${PREFIX}/bin
        ${INSTALL_DATA} ${WRKSRC}/README.md ${DESTDIR}${PREFIX}/share/doc/${PKGBASE}
diff -r 798e52adf21a -r c23faa2f0571 net/tcpexec/distinfo
--- a/net/tcpexec/distinfo      Mon Apr 25 15:24:31 2022 +0000
+++ b/net/tcpexec/distinfo      Mon Apr 25 15:33:58 2022 +0000
@@ -1,7 +1,7 @@
-$NetBSD: distinfo,v 1.1 2021/11/15 11:36:58 schmonz Exp $
+$NetBSD: distinfo,v 1.2 2022/04/25 15:33:58 tnn Exp $
 
 BLAKE2s (tcpexec/7e02e755aca4cb377910b729e43de8e3fb48eece-7e02e755aca4cb377910b729e43de8e3fb48eece.tar.gz) = 3e833e3aeb0a7bf8023ee870b1e5a1c39c10804037fbb6541470a018c646db0b
 SHA512 (tcpexec/7e02e755aca4cb377910b729e43de8e3fb48eece-7e02e755aca4cb377910b729e43de8e3fb48eece.tar.gz) = 
d1ad7ff52499a3287cadf4f44ce012a2bb9eeeaca2c77c75caa12fdcff2c09b60fefa396ebcb4dc3478acea1340e8ba322955ed9bb8f73af33a39254e545f801
 Size (tcpexec/7e02e755aca4cb377910b729e43de8e3fb48eece-7e02e755aca4cb377910b729e43de8e3fb48eece.tar.gz) = 4219 bytes
 SHA1 (patch-Makefile) = 17d61c1e7da32f51f528e282152f47601065c31b
-SHA1 (patch-tcpexec.c) = d87d6cde188efc84905348cac092de9488078741
+SHA1 (patch-tcpexec.c) = 79efc2368f688bb6edfa434f721dd37c8ad3be75
diff -r 798e52adf21a -r c23faa2f0571 net/tcpexec/patches/patch-tcpexec.c
--- a/net/tcpexec/patches/patch-tcpexec.c       Mon Apr 25 15:24:31 2022 +0000
+++ b/net/tcpexec/patches/patch-tcpexec.c       Mon Apr 25 15:33:58 2022 +0000
@@ -1,6 +1,6 @@
-$NetBSD: patch-tcpexec.c,v 1.1 2021/11/15 11:36:58 schmonz Exp $
+$NetBSD: patch-tcpexec.c,v 1.2 2022/04/25 15:33:58 tnn Exp $
 
-Fix macOS build.
+Fix build without close-on-exec and/or SO_REUSEPORT.
 
 --- tcpexec.c.orig     2021-11-13 13:34:51.000000000 +0000
 +++ tcpexec.c
@@ -14,3 +14,14 @@
      fd = socket(rp->ai_family, rp->ai_socktype | SOCK_CLOEXEC, rp->ai_protocol);
  
      if (fd == -1)
+@@ -160,8 +163,10 @@ static int tcpexec_listen(const char *ad
+     if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(enable)) == -1)
+       return -1;
+ 
++#ifdef SO_REUSEPORT
+     if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &enable, sizeof(enable)) == -1)
+       return -1;
++#endif
+ 
+     if (bind(fd, rp->ai_addr, rp->ai_addrlen) == -1)
+       return -1;



Home | Main Index | Thread Index | Old Index