sendto should always call send if to == NULL || tolen <= 0
Since UDP socket may bind the target with connect call
This commit is contained in:
parent
7e67add999
commit
0fc7668d65
@ -139,13 +139,7 @@ ssize_t psock_sendto(FAR struct socket *psock, FAR const void *buf,
|
||||
|
||||
if (to == NULL || tolen <= 0)
|
||||
{
|
||||
#if defined(CONFIG_NET_TCP) || defined(CONFIG_NET_LOCAL_STREAM) || \
|
||||
defined(CONFIG_NET_USRSOCK)
|
||||
return psock_send(psock, buf, len, flags);
|
||||
#else
|
||||
nerr("ERROR: No 'to' address\n");
|
||||
return -EINVAL;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Verify that the psock corresponds to valid, allocated socket */
|
||||
|
Loading…
Reference in New Issue
Block a user