Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Dec 2019 08:13:39 +0000 (UTC)
From:      Kurt Jaeger <pi@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r520227 - in head/net/miniupnpd: . files
Message-ID:  <201912160813.xBG8DdTp021446@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pi
Date: Mon Dec 16 08:13:39 2019
New Revision: 520227
URL: https://svnweb.freebsd.org/changeset/ports/520227

Log:
  net/miniupnpd: Fix build when CHECK_PORTINUSE option enabled
  
  PR:		233963
  Reported by:	ncrogers@gmail.com
  Submitted by:	w.schwarzenfeld@utanet.at
  Reviewed by:	franco@opnsense.org
  Approved by:	squat@squat.no (maintainer)

Added:
  head/net/miniupnpd/files/extra-patch-portinuse.c   (contents, props changed)
Deleted:
  head/net/miniupnpd/files/patch-portinuse.c
Modified:
  head/net/miniupnpd/Makefile

Modified: head/net/miniupnpd/Makefile
==============================================================================
--- head/net/miniupnpd/Makefile	Mon Dec 16 08:07:07 2019	(r520226)
+++ head/net/miniupnpd/Makefile	Mon Dec 16 08:13:39 2019	(r520227)
@@ -37,6 +37,12 @@ UPNP_IGDV2_EXTRA_PATCHES=	${PATCHDIR}/enable_igdv2.pat
 UPNP_STRICT_EXTRA_PATCHES=	${PATCHDIR}/enable_upnp_strict.patch
 LEASEFILE_EXTRA_PATCHES=	${PATCHDIR}/enable_leasefile.patch
 
+.include <bsd.port.options.mk>
+
+.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1200000
+EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-portinuse.c
+.endif
+
 post-patch:
 	${REINPLACE_CMD} -e 's|\(-lssl -lcrypto\)|$$(LDFLAGS) \1|g' \
 	${WRKSRC}/Makefile

Added: head/net/miniupnpd/files/extra-patch-portinuse.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/miniupnpd/files/extra-patch-portinuse.c	Mon Dec 16 08:13:39 2019	(r520227)
@@ -0,0 +1,49 @@
+--- portinuse.c.orig	2017-11-02 17:38:02 UTC
++++ portinuse.c
+@@ -280,7 +280,7 @@ static struct nlist list[] = {
+ 	struct xinpgen *xig, *exig;
+ 	struct xinpcb *xip;
+ 	struct xtcpcb *xtp;
+-	struct inpcb *inp;
++	struct in_conninfo *inc;
+ 	void *buf = NULL;
+ 	size_t len;
+ 
+@@ -339,7 +339,8 @@ static struct nlist list[] = {
+ 				free(buf);
+ 				return -1;
+ 			}
+-			inp = &xtp->xt_inp;
++			xip = &xtp->xt_inp;
++			inc = &xip->inp_inc;
+ 			break;
+ 		case IPPROTO_UDP:
+ 			xip = (struct xinpcb *)xig;
+@@ -349,21 +350,21 @@ static struct nlist list[] = {
+ 				free(buf);
+ 				return -1;
+ 			}
+-			inp = &xip->xi_inp;
++			inc = &xip->inp_inc;
+ 			break;
+ 		default:
+ 			abort();
+ 		}
+ 		/* no support for IPv6 */
+-		if ((inp->inp_vflag & INP_IPV6) != 0)
++		if ((xip->inp_vflag & INP_IPV6) != 0)
+ 			continue;
+ 		syslog(LOG_DEBUG, "%08lx:%hu %08lx:%hu <=> %hu %08lx:%hu",
+-		       (u_long)inp->inp_laddr.s_addr, ntohs(inp->inp_lport),
+-		       (u_long)inp->inp_faddr.s_addr, ntohs(inp->inp_fport),
++		       (u_long)inc->inc_laddr.s_addr, ntohs(inc->inc_lport),
++		       (u_long)inc->inc_faddr.s_addr, ntohs(inc->inc_fport),
+ 		       eport, (u_long)ip_addr.s_addr, iport
+ 		);
+-		if (eport == (unsigned)ntohs(inp->inp_lport)) {
+-			if (inp->inp_laddr.s_addr == INADDR_ANY || inp->inp_laddr.s_addr == ip_addr.s_addr) {
++		if (eport == (unsigned)ntohs(inc->inc_lport)) {
++			if (inc->inc_laddr.s_addr == INADDR_ANY || inc->inc_laddr.s_addr == ip_addr.s_addr) {
+ 				found++;
+ 				break;  /* don't care how many, just that we found at least one */
+ 			}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912160813.xBG8DdTp021446>