Fixed invalid SOCK_ADDR_TYPE_MATCH check in lwip_sendto()

This commit is contained in:
goldsimon 2011-07-04 19:39:16 +00:00
parent 09ac68c196
commit 1813d11b9d

View File

@ -864,7 +864,7 @@ lwip_sendto(int s, const void *data, size_t size, int flags,
#endif /* LWIP_TCP */
}
if (!SOCK_ADDR_TYPE_MATCH(to, sock)) {
if ((to != NULL) && !SOCK_ADDR_TYPE_MATCH(to, sock)) {
/* sockaddr does not match socket type (IPv4/IPv6) */
sock_set_errno(sock, err_to_errno(ERR_VAL));
return -1;