From 82a6e9f0cca6f1fe4f785e5276c46dbed62825ca Mon Sep 17 00:00:00 2001 From: Marcelo Roberto Jimenez Date: Fri, 10 Sep 2010 00:18:24 -0300 Subject: [PATCH] Fix for coding style and compiler warning message: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit src/genlib/miniserver/miniserver.c: In function ‘get_miniserver_sockets’: src/genlib/miniserver/miniserver.c:592: warning: unused variable ‘actual_port6’ src/genlib/miniserver/miniserver.c:582: warning: unused variable ‘__ss_v6’ --- ChangeLog | 3 +++ upnp/src/genlib/miniserver/miniserver.c | 17 +++++++---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index f02f5be..d9704aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ Version 1.8.0 ******************************************************************************* +2010-09-10 Chandra Penke + Add support for conditionally enabling ipv6. + 2010-08-22 Marcelo Jimenez * upnp/src/api/Discovery.c: Fix a serious bug and memory leak in UpnpDiscovery_strcpy_DeviceType(). Thanks to David Blanchet for the diff --git a/upnp/src/genlib/miniserver/miniserver.c b/upnp/src/genlib/miniserver/miniserver.c index 80ad18b..9d6e04f 100644 --- a/upnp/src/genlib/miniserver/miniserver.c +++ b/upnp/src/genlib/miniserver/miniserver.c @@ -579,22 +579,21 @@ static int get_miniserver_sockets( { char errorBuffer[ERROR_BUFFER_LEN]; struct sockaddr_storage __ss_v4; - struct sockaddr_storage __ss_v6; struct sockaddr_in* serverAddr4 = (struct sockaddr_in*)&__ss_v4; -#ifdef UPNP_ENABLE_IPV6 - struct sockaddr_in6* serverAddr6 = (struct sockaddr_in6*)&__ss_v6; -#endif SOCKET listenfd4 = INVALID_SOCKET; + unsigned short actual_port4; #ifdef UPNP_ENABLE_IPV6 + struct sockaddr_storage __ss_v6; + struct sockaddr_in6* serverAddr6 = (struct sockaddr_in6*)&__ss_v6; SOCKET listenfd6 = INVALID_SOCKET; + unsigned short actual_port6; #endif int ret_code; - unsigned short actual_port4, actual_port6; int reuseaddr_on = 0; int sockError = UPNP_E_SUCCESS; int errCode = 0; - // + // // Initialize all the sockets to be invalid // out->miniServerSock4 = INVALID_SOCKET; @@ -678,8 +677,7 @@ static int get_miniserver_sockets( } #ifdef UPNP_ENABLE_IPV6 - if(listenfd6 != INVALID_SOCKET) - { + if (listenfd6 != INVALID_SOCKET) { sockError = setsockopt(listenfd6, SOL_SOCKET, SO_REUSEADDR, (const char *)&reuseaddr_on, sizeof (int)); if (sockError == -1) { @@ -706,8 +704,7 @@ static int get_miniserver_sockets( } } #endif //IPv6 - } else - { + } else { if (listenfd4 != INVALID_SOCKET) { unsigned short orig_listen_port4 = listen_port4; do {