diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2012-03-22 12:09:40 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-04-24 10:56:39 -0400 |
commit | cffc85bb0b606947b2368fa28bed03c066e1e686 (patch) | |
tree | bbafbb927851d5c97e0062eeed5720612e08d967 /src/tools/tor-fw-helper | |
parent | bdd7e2878b642e3ab06a62d9097ae5e7484240e9 (diff) | |
download | tor-cffc85bb0b606947b2368fa28bed03c066e1e686.tar tor-cffc85bb0b606947b2368fa28bed03c066e1e686.tar.gz |
Fix compile error against miniupnpc-1.6 when --enable-upnp
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=376621
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/tools/tor-fw-helper')
-rw-r--r-- | src/tools/tor-fw-helper/tor-fw-helper-upnp.c | 8 |
1 files changed, 8 insertions, 0 deletions
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 442eae514..ee56f7162 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 = 0; +#ifdef MINIUPNPC15 devlist = upnpDiscover(UPNP_DISCOVER_TIMEOUT, NULL, NULL, 0); +#else + devlist = upnpDiscover(UPNP_DISCOVER_TIMEOUT, NULL, NULL, 0, 0, NULL); +#endif if (NULL == 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 = 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 != UPNPCOMMAND_SUCCESS) return UPNP_ERR_ADDPORTMAPPING; |