Fixed bug #45098 ip_addr_t type field not populated for socket address copies (patch by James Smith)

This commit is contained in:
goldsimon 2015-05-21 15:51:47 +02:00
parent b51805b87e
commit 232cf8c28b

View File

@ -338,8 +338,10 @@ sockaddr_to_ipaddr_port(const struct sockaddr* sockaddr, ip_addr_t* ipaddr, u16_
{
if ((sockaddr->sa_family) == AF_INET6) {
SOCKADDR6_TO_IP6ADDR_PORT((const struct sockaddr_in6*)(const void*)(sockaddr), ipaddr, *port);
ipaddr->type = IPADDR_TYPE_V6;
} else {
SOCKADDR4_TO_IP4ADDR_PORT((const struct sockaddr_in*)(const void*)(sockaddr), ipaddr, *port);
ipaddr->type = IPADDR_TYPE_V4;
}
}
#endif /* LWIP_IPV4 && LWIP_IPV6 */