From 77aaeb932b6c4fd882d7b22032836b2b11052ae4 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 27 Jun 2010 15:29:23 +0000 Subject: [PATCH] (trunk libT) don't try to port forward through your cablebox just because it's hooked up to the local network... --- libtransmission/upnp.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libtransmission/upnp.c b/libtransmission/upnp.c index d6ff61181..00e8e7745 100644 --- a/libtransmission/upnp.c +++ b/libtransmission/upnp.c @@ -77,6 +77,14 @@ tr_upnpClose( tr_upnp * handle ) *** **/ +enum +{ + UPNP_IGD_NONE = 0, + UPNP_IGD_VALID_CONNECTED = 1, + UPNP_IGD_VALID_NOT_CONNECTED = 2, + UPNP_IGD_INVALID = 3 +}; + int tr_upnpPulse( tr_upnp * handle, int port, @@ -98,7 +106,7 @@ tr_upnpPulse( tr_upnp * handle, } errno = 0; if( UPNP_GetValidIGD( devlist, &handle->urls, &handle->data, - handle->lanaddr, sizeof( handle->lanaddr ) ) ) + handle->lanaddr, sizeof( handle->lanaddr ) ) == UPNP_IGD_VALID_CONNECTED ) { tr_ninf( getKey( ), _( "Found Internet Gateway Device \"%s\"" ),