From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SAsrz-0007w9-1H for garchives@archives.gentoo.org; Fri, 23 Mar 2012 01:00:43 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 55CD3E0AC9; Fri, 23 Mar 2012 01:00:34 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 18160E0AC9 for ; Fri, 23 Mar 2012 01:00:34 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 54A6C1B4010 for ; Fri, 23 Mar 2012 01:00:33 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 2273) id 243282004C; Fri, 23 Mar 2012 01:00:32 +0000 (UTC) From: "Anthony G. Basile (blueness)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, blueness@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in net-misc/tor/files: tor-0.2.3.12_alpha-fix-miniupnpc-1.6.patch X-VCS-Repository: gentoo-x86 X-VCS-Files: tor-0.2.3.12_alpha-fix-miniupnpc-1.6.patch X-VCS-Directories: net-misc/tor/files X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile Content-Type: text/plain; charset=utf8 Message-Id: <20120323010032.243282004C@flycatcher.gentoo.org> Date: Fri, 23 Mar 2012 01:00:32 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 63a13b40-ab8c-43df-b50b-fdba56074b84 X-Archives-Hash: e085195475ea443c0a1f7e01adf554eb blueness 12/03/23 01:00:32 Added: tor-0.2.3.12_alpha-fix-miniupnpc-1.6.patch Log: Add patch to fix bug #376621 =20 (Portage version: 2.1.10.49/cvs/Linux x86_64) Revision Changes Path 1.1 net-misc/tor/files/tor-0.2.3.12_alpha-fix-miniupnpc-= 1.6.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/tor/files= /tor-0.2.3.12_alpha-fix-miniupnpc-1.6.patch?rev=3D1.1&view=3Dmarkup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/tor/files= /tor-0.2.3.12_alpha-fix-miniupnpc-1.6.patch?rev=3D1.1&content-type=3Dtext= /plain Index: tor-0.2.3.12_alpha-fix-miniupnpc-1.6.patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >From cc6282b77e6f1284d1381e02511720ae2adc7c96 Mon Sep 17 00:00:00 2001 From: Anthony G. Basile Date: Thu, 22 Mar 2012 12:09:40 -0400 Subject: [PATCH] Fix compile error against miniupnpc-1.6 when --enable-up= np The bump from miniupnpc-1.5 to 1.6 changes the definition of two functions used by tor-fw-helper-upnp.c, upnpDiscover() and UPNP_AddPortMapping(). This patch addresses this and adds a check in configure.in for backwards compatibility. Thanks to Nickolay Kolchin-Semyonov for some hints. X-Tor-Bug-URL: https://trac.torproject.org/projects/tor/ticket/5434 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=3D376621 Signed-off-by: Anthony G. Basile --- configure.in | 37 +++++++++++++++++++-= ----- src/tools/tor-fw-helper/tor-fw-helper-upnp.c | 8 +++++ 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/configure.in b/configure.in index 7415ce8..946f780 100644 --- a/configure.in +++ b/configure.in @@ -592,15 +592,34 @@ dnl There are no packages for Debian or Redhat as o= f this patch =20 if test "$upnp" =3D "true"; then AC_DEFINE(MINIUPNPC, 1, [Define to 1 if we are building with UPnP.]) - TOR_SEARCH_LIBRARY(libminiupnpc, $trylibminiupnpcdir, [-lminiupnpc $= TOR_LIB_WS32 $TOR_LIB_IPHLPAPI], - [#include - #include - #include ], - [void upnpDiscover(int delay, const char * multicastif, - const char * minissdpdsock, int sameport);], - [upnpDiscover(1, 0, 0, 0); exit(0);], - [--with-libminiupnpc-dir], - [/usr/lib/]) + + dnl Before we call TOR_SEARCH_LIBRARY we'll do a quick compile test + dnl to see if we have miniupnpc-1.5 or -1.6 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include = ], + [upnpDiscover(1, 0, 0, 0);exit(0);])],[miniupnpc15=3D"true"],[mi= niupnpc15=3D"false"]) + + if test "$miniupnpc15" =3D "true" ; then + AC_DEFINE([MINIUPNPC15],[1],[libminiupnpc version 1.5 found]) + TOR_SEARCH_LIBRARY(libminiupnpc, $trylibminiupnpcdir, [-lminiupn= pc $TOR_LIB_WS32 $TOR_LIB_IPHLPAPI], + [#include + #include + #include ], + [void upnpDiscover(int delay, const char * multicastif, + const char * minissdpdsock, int sameport);], + [upnpDiscover(1, 0, 0, 0); exit(0);], + [--with-libminiupnpc-dir], + [/usr/lib/]) + else + TOR_SEARCH_LIBRARY(libminiupnpc, $trylibminiupnpcdir, [-lminiupn= pc $TOR_LIB_WS32 $TOR_LIB_IPHLPAPI], + [#include + #include + #include ], + [void upnpDiscover(int delay, const char * multicastif, + const char * minissdpdsock, int sameport, int ipv6, int * e= rror);], + [upnpDiscover(1, 0, 0, 0, 0, 0); exit(0);], + [--with-libminiupnpc-dir], + [/usr/lib/]) + fi fi =20 AC_SYS_LARGEFILE diff --git a/src/tools/tor-fw-helper/tor-fw-helper-upnp.c b/src/tools/tor= -fw-helper/tor-fw-helper-upnp.c index 442eae5..ee56f71 100644 --- a/src/tools/tor-fw-helper/tor-fw-helper-upnp.c +++ b/src/tools/tor-fw-helper/tor-fw-helper-upnp.c @@ -78,7 +78,11 @@ tor_upnp_init(tor_fw_options_t *options, void *backend= _state) memset(&(state->data), 0, sizeof(struct IGDdatas)); state->init =3D 0; =20 +#ifdef MINIUPNPC15 devlist =3D upnpDiscover(UPNP_DISCOVER_TIMEOUT, NULL, NULL, 0); +#else + devlist =3D upnpDiscover(UPNP_DISCOVER_TIMEOUT, NULL, NULL, 0, 0, NULL= ); +#endif if (NULL =3D=3D devlist) { fprintf(stderr, "E: upnpDiscover returned: NULL\n"); return UPNP_ERR_NODEVICESFOUND; @@ -178,7 +182,11 @@ tor_upnp_add_tcp_mapping(tor_fw_options_t *options, = void *backend_state) r =3D UPNP_AddPortMapping(state->urls.controlURL, state->data.first.servicetype, external_port_str, internal_port_str, +#ifdef MINIUPNPC15 state->lanaddr, UPNP_DESC, "TCP", 0); +#else + state->lanaddr, UPNP_DESC, "TCP", 0, 0); +#endif if (r !=3D UPNPCOMMAND_SUCCESS) return UPNP_ERR_ADDPORTMAPPING; =20 --=20 1.7.3.4