From 0fc7668d657efca2702227a22bdcb9ea684c8519 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Fri, 31 Jan 2020 18:00:39 +0800 Subject: [PATCH] sendto should always call send if to == NULL || tolen <= 0 Since UDP socket may bind the target with connect call --- net/socket/sendto.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/net/socket/sendto.c b/net/socket/sendto.c index 55efcced61c..7dd247975f2 100644 --- a/net/socket/sendto.c +++ b/net/socket/sendto.c @@ -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 */