The library doesn't build with --disable-client.
diff --git a/upnp/src/ssdp/ssdp_server.c b/upnp/src/ssdp/ssdp_server.c index ea53ede..d21ac50 100644 --- a/upnp/src/ssdp/ssdp_server.c +++ b/upnp/src/ssdp/ssdp_server.c @@ -889,34 +889,6 @@ error_handler: return ret; } -#ifdef INCLUDE_CLIENT_APIS -/*! - * \brief Creates the SSDP IPv4 socket to be used by the control point. - * - * \return UPNP_E_SUCCESS on successful socket creation. - */ -static int create_ssdp_sock_reqv4( - /*! [out] SSDP IPv4 request socket to be created. */ - SOCKET *ssdpReqSock) -{ - char errorBuffer[ERROR_BUFFER_LEN]; - u_char ttl = 4; - - *ssdpReqSock = socket(AF_INET, SOCK_DGRAM, 0); - if (*ssdpReqSock == INVALID_SOCKET) { - strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN); - UpnpPrintf(UPNP_CRITICAL, SSDP, __FILE__, __LINE__, - "Error in socket(): %s\n", errorBuffer); - return UPNP_E_OUTOF_SOCKET; - } - setsockopt(*ssdpReqSock, IPPROTO_IP, IP_MULTICAST_TTL, - &ttl, sizeof(ttl)); - /* just do it, regardless if fails or not. */ - sock_make_no_blocking(*ssdpReqSock); - - return UPNP_E_SUCCESS; -} - #ifdef UPNP_ENABLE_IPV6 /*! * \brief This function ... @@ -1134,6 +1106,34 @@ error_handler: } #endif /* IPv6 */ +#ifdef INCLUDE_CLIENT_APIS +/*! + * \brief Creates the SSDP IPv4 socket to be used by the control point. + * + * \return UPNP_E_SUCCESS on successful socket creation. + */ +static int create_ssdp_sock_reqv4( + /*! [out] SSDP IPv4 request socket to be created. */ + SOCKET *ssdpReqSock) +{ + char errorBuffer[ERROR_BUFFER_LEN]; + u_char ttl = 4; + + *ssdpReqSock = socket(AF_INET, SOCK_DGRAM, 0); + if (*ssdpReqSock == INVALID_SOCKET) { + strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN); + UpnpPrintf(UPNP_CRITICAL, SSDP, __FILE__, __LINE__, + "Error in socket(): %s\n", errorBuffer); + return UPNP_E_OUTOF_SOCKET; + } + setsockopt(*ssdpReqSock, IPPROTO_IP, IP_MULTICAST_TTL, + &ttl, sizeof(ttl)); + /* just do it, regardless if fails or not. */ + sock_make_no_blocking(*ssdpReqSock); + + return UPNP_E_SUCCESS; +} + /*! * \brief Creates the SSDP IPv6 socket to be used by the control point. */