From a362d06dffbaf9c71056ab1b7bcfe1f0d2ba8a31 Mon Sep 17 00:00:00 2001 From: Marcelo Roberto Jimenez Date: Sat, 21 Aug 2010 22:13:26 +0000 Subject: [PATCH] upnp/src/genlib/miniserver/miniserver.c: Fix for IPV6 ULA/GUA issues. git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.6.x@576 119443c7-1b9e-41f8-b6fc-b9c35fce742c --- ChangeLog | 5 +++++ upnp/src/genlib/miniserver/miniserver.c | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9ba25d3..10d996a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,11 @@ Version 1.6.7 ******************************************************************************* +2010-08-21 Marcelo Jimenez + * upnp/src/genlib/miniserver/miniserver.c: Fix for IPV6 ULA/GUA issues. + + Patch submitted by Ronan Menard. + 2010-08-21 Marcelo Jimenez * gena_subscribe(): Fix for IPV6 ULA/GUA issues. diff --git a/upnp/src/genlib/miniserver/miniserver.c b/upnp/src/genlib/miniserver/miniserver.c index 4d69efd..842339c 100644 --- a/upnp/src/genlib/miniserver/miniserver.c +++ b/upnp/src/genlib/miniserver/miniserver.c @@ -327,6 +327,7 @@ static void RunMiniServer( SOCKET miniServStopSock = miniSock->miniServerStopSock; SOCKET ssdpSock4 = miniSock->ssdpSock4; SOCKET ssdpSock6 = miniSock->ssdpSock6; + SOCKET ssdpSock6UlaGua = miniSock->ssdpSock6UlaGua; #ifdef INTERNAL_WEB_SERVER SOCKET miniServSock4 = miniSock->miniServerSock4; SOCKET miniServSock6 = miniSock->miniServerSock6; @@ -357,6 +358,9 @@ static void RunMiniServer( if (ssdpSock6 != INVALID_SOCKET) { maxMiniSock = max(maxMiniSock, ssdpSock6); } + if (ssdpSock6UlaGua != INVALID_SOCKET) { + maxMiniSock = max(maxMiniSock, ssdpSock6UlaGua); + } #ifdef INCLUDE_CLIENT_APIS if (ssdpReqSock4 != INVALID_SOCKET) { maxMiniSock = max(maxMiniSock, ssdpReqSock4); @@ -389,6 +393,9 @@ static void RunMiniServer( if(ssdpSock6 != INVALID_SOCKET) { FD_SET(ssdpSock6, &rdSet); } + if(ssdpSock6UlaGua != INVALID_SOCKET) { + FD_SET(ssdpSock6UlaGua, &rdSet); + } #ifdef INCLUDE_CLIENT_APIS if(ssdpReqSock4 != INVALID_SOCKET) { FD_SET(ssdpReqSock4, &rdSet); @@ -454,6 +461,10 @@ static void RunMiniServer( FD_ISSET(ssdpSock6, &rdSet)) { readFromSSDPSocket(ssdpSock6); } + if (ssdpSock6UlaGua != INVALID_SOCKET && + FD_ISSET(ssdpSock6UlaGua, &rdSet)) { + readFromSSDPSocket(ssdpSock6UlaGua); + } if (ssdpSock4 != INVALID_SOCKET && FD_ISSET(ssdpSock4, &rdSet)) { readFromSSDPSocket(ssdpSock4); @@ -494,6 +505,8 @@ static void RunMiniServer( UpnpCloseSocket(ssdpSock4); shutdown(ssdpSock6, SD_BOTH); UpnpCloseSocket(ssdpSock6); + shutdown(ssdpSock6UlaGua, SD_BOTH); + UpnpCloseSocket(ssdpSock6UlaGua); #ifdef INCLUDE_CLIENT_APIS shutdown(ssdpReqSock4, SD_BOTH); UpnpCloseSocket(ssdpReqSock4); @@ -930,6 +943,8 @@ int StartMiniServer( UpnpCloseSocket(miniSocket->ssdpSock4); shutdown(miniSocket->ssdpSock6, SD_BOTH); UpnpCloseSocket(miniSocket->ssdpSock6); + shutdown(miniSocket->ssdpSock6UlaGua, SD_BOTH); + UpnpCloseSocket(miniSocket->ssdpSock6UlaGua); #ifdef INCLUDE_CLIENT_APIS shutdown(miniSocket->ssdpReqSock4, SD_BOTH ); UpnpCloseSocket(miniSocket->ssdpReqSock4 ); @@ -959,6 +974,8 @@ int StartMiniServer( UpnpCloseSocket(miniSocket->ssdpSock4); shutdown(miniSocket->ssdpSock6, SD_BOTH); UpnpCloseSocket(miniSocket->ssdpSock6); + shutdown(miniSocket->ssdpSock6UlaGua, SD_BOTH); + UpnpCloseSocket(miniSocket->ssdpSock6UlaGua); #ifdef INCLUDE_CLIENT_APIS shutdown(miniSocket->ssdpReqSock4, SD_BOTH); UpnpCloseSocket(miniSocket->ssdpReqSock4);