--- a/src/utils/net/upnp_stubs.c 2012-03-15 13:55:55.980743154 +0800 +++ a/src/utils/net/upnp_stubs.c 2012-03-15 13:55:10.797405733 +0800 @@ -639,7 +639,14 @@ { struct UPNPDev * devlist; errno = 0; +#ifndef UPNPDISCOVER_SUCCESS + /* miniupnpc 1.5 */ devlist = upnpDiscover( 2000, NULL, NULL, 0 ); +#else + /* miniupnpc 1.6 */ + int error = 0; + devlist = upnpDiscover( 2000, NULL, NULL, 0, 0, &error); +#endif if( devlist == NULL ) { dbg_printf( "upnpDiscover failed (errno %d - %s)\n", errno, str_errno( errno ) ); @@ -680,7 +687,12 @@ snprintf( type, sizeof( type ), "%s", ( map->isTcp ? "TCP" : "UDP" ) ); i = UPNP_GetSpecificPortMappingEntry( map->upnpUrls.controlURL, map->upnpData.first.servicetype, portStr, - type, intClient, intPort ); + type, intClient, intPort +#ifdef UPNPDISCOVER_SUCCESS + /* miniupnpc 1.6 */ + , NULL, NULL, NULL +#endif + ); if( i != UPNPCOMMAND_SUCCESS ) { dbg_printf( "Port %d isn't forwarded\n", map->extPort ); @@ -730,7 +742,12 @@ err = UPNP_AddPortMapping( map->upnpUrls.controlURL, map->upnpData.first.servicetype, extPortStr, intPortStr, map->lanaddr, - desc, type, NULL ); + desc, type, NULL +#ifdef UPNPDISCOVER_SUCCESS + /* miniupnpc 1.6 */ + , NULL +#endif + ); map->upnpMapped = !err; } dbg_printf( "Port forwarding through \"%s\", service \"%s\". (local address[%s:%d])\n", map->upnpUrls.controlURL, map->upnpData.first.servicetype, map->lanaddr, map->intPort );