Merge branch 'issue-467'

This commit is contained in:
Thomas Bernard 2020-06-06 19:35:27 +02:00
commit ddf99b3504
2 changed files with 17 additions and 1 deletions

View File

@ -1,5 +1,8 @@
$Id: Changelog.txt,v 1.464 2020/05/10 17:57:56 nanard Exp $ $Id: Changelog.txt,v 1.464 2020/05/10 17:57:56 nanard Exp $
2020/06/05:
fix handling of ipv4 M-SEARCH received on ipv6 sockets
2020/06/03: 2020/06/03:
configure --disable-fork to disable going to background configure --disable-fork to disable going to background
improve upnp_get_portmapping_number_of_entries() improve upnp_get_portmapping_number_of_entries()

View File

@ -1126,7 +1126,13 @@ ProcessSSDPData(int s, const char *bufr, int n,
syslog(LOG_INFO, "SSDP M-SEARCH from %s ST: %.*s", syslog(LOG_INFO, "SSDP M-SEARCH from %s ST: %.*s",
sender_str, st_len, st); sender_str, st_len, st);
/* find in which sub network the client is */ /* find in which sub network the client is */
#ifdef ENABLE_IPV6
if((sender->sa_family == AF_INET) ||
(sender->sa_family == AF_INET6 &&
IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)sender)->sin6_addr)))
#else
if(sender->sa_family == AF_INET) if(sender->sa_family == AF_INET)
#endif
{ {
if (lan_addr == NULL) if (lan_addr == NULL)
{ {
@ -1138,7 +1144,7 @@ ProcessSSDPData(int s, const char *bufr, int n,
announced_host = lan_addr->str; announced_host = lan_addr->str;
} }
#ifdef ENABLE_IPV6 #ifdef ENABLE_IPV6
else else if(sender->sa_family == AF_INET6)
{ {
/* IPv6 address with brackets */ /* IPv6 address with brackets */
#ifdef UPNP_STRICT #ifdef UPNP_STRICT
@ -1178,6 +1184,13 @@ ProcessSSDPData(int s, const char *bufr, int n,
#endif #endif
} }
#endif #endif
else
{
syslog(LOG_ERR,
"Unknown address family %d for client %s",
sender->sa_family, sender_str);
return;
}
/* Responds to request with a device as ST header */ /* Responds to request with a device as ST header */
for(i = 0; known_service_types[i].s; i++) for(i = 0; known_service_types[i].s; i++)
{ {