From 79a09bfd6eab2074b30336953e9be6ce74628dc5 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 14 Jul 2017 12:48:53 -0600 Subject: [PATCH] Socket I/F: Fix bad copy-past error. sendto() was called the address family's send() instead of sendto(). --- configs/sim/README.txt | 3 +++ configs/sim/udgram/defconfig | 7 ++++--- net/socket/sendto.c | 8 ++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/configs/sim/README.txt b/configs/sim/README.txt index 20f76fbf29..be8d47456c 100644 --- a/configs/sim/README.txt +++ b/configs/sim/README.txt @@ -909,6 +909,9 @@ udgram nsh> server & nsh> client + For the sake of sanity, binfs and logins are disabled in this + configuration. + unionfs This is a version of NSH dedicated to performing the simple test diff --git a/configs/sim/udgram/defconfig b/configs/sim/udgram/defconfig index 913e36117e..64f8e6f20a 100644 --- a/configs/sim/udgram/defconfig +++ b/configs/sim/udgram/defconfig @@ -15,14 +15,15 @@ CONFIG_DEBUG_SYMBOLS=y CONFIG_DISABLE_POLL=y CONFIG_EXAMPLES_HELLO=y CONFIG_EXAMPLES_NSH=y +CONFIG_EXAMPLES_UDGRAM_CLIENT_STACKSIZE=8192 +CONFIG_EXAMPLES_UDGRAM_SERVER_STACKSIZE=8192 CONFIG_EXAMPLES_UDGRAM=y CONFIG_FAT_LCNAMES=y CONFIG_FAT_LFN=y -CONFIG_FS_BINFS=y CONFIG_FS_FAT=y CONFIG_FS_PROCFS=y CONFIG_FS_ROMFS=y -CONFIG_IDLETHREAD_STACKSIZE=4096 +CONFIG_IDLETHREAD_STACKSIZE=8192 CONFIG_LIBC_EXECFUNCS=y CONFIG_MAX_TASKS=64 CONFIG_NET_LOCAL=y @@ -45,4 +46,4 @@ CONFIG_SIM_WALLTIME=y CONFIG_START_MONTH=6 CONFIG_START_YEAR=2008 CONFIG_USER_ENTRYPOINT="nsh_main" -CONFIG_USERMAIN_STACKSIZE=4096 +CONFIG_USERMAIN_STACKSIZE=8192 diff --git a/net/socket/sendto.c b/net/socket/sendto.c index 6ddf2a5958..acac383cd7 100644 --- a/net/socket/sendto.c +++ b/net/socket/sendto.c @@ -150,17 +150,17 @@ ssize_t psock_sendto(FAR struct socket *psock, FAR const void *buf, /* Verify that the psock corresponds to valid, allocated socket */ - if (!psock || psock->s_crefs <= 0) + if (psock == NULL || psock->s_crefs <= 0) { nerr("ERROR: Invalid socket\n"); errcode = EBADF; goto errout; } - /* Let the address family's send() method handle the operation */ + /* Let the address family's sendto() method handle the operation */ - DEBUGASSERT(psock->s_sockif != NULL && psock->s_sockif->si_send != NULL); - nsent = psock->s_sockif->si_send(psock, buf, len, flags); + DEBUGASSERT(psock->s_sockif != NULL && psock->s_sockif->si_sendto != NULL); + nsent = psock->s_sockif->si_sendto(psock, buf, len, flags, to, tolen); /* Check if the domain-specific sendto() logic failed */