From 88b94b5116f75572bcf14574535ecde437c2b4bd Mon Sep 17 00:00:00 2001 From: Gustavo Zacarias Date: Wed, 11 Apr 2012 11:17:45 -0300 Subject: [PATCH] ssdp_device: exclude IPv6 stuff when there's no IPv6 Add an additional INET_IPV6 exclusion around IPV6_MULTICAST_HOPS since the definition isn't guaranteed to exist when the toolchain lacks IPv6 support. Signed-off-by: Gustavo Zacarias (cherry picked from commit 1c21e6e54f035576afeb84bd90bdf5f754041105) --- upnp/src/ssdp/ssdp_device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/upnp/src/ssdp/ssdp_device.c b/upnp/src/ssdp/ssdp_device.c index d3517cc..a439005 100644 --- a/upnp/src/ssdp/ssdp_device.c +++ b/upnp/src/ssdp/ssdp_device.c @@ -210,6 +210,7 @@ static int NewRequestHandler( (char *)&ttl, sizeof(int)); socklen = sizeof(struct sockaddr_in); break; +#ifdef INET_IPV6 case AF_INET6: inet_ntop(AF_INET6, &((struct sockaddr_in6 *)DestAddr)->sin6_addr, @@ -219,6 +220,7 @@ static int NewRequestHandler( setsockopt(ReplySock, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, (char *)&hops, sizeof(hops)); break; +#endif default: UpnpPrintf(UPNP_CRITICAL, SSDP, __FILE__, __LINE__, "Invalid destination address specified.");