You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ma...@apache.org on 2020/08/06 11:52:21 UTC

[incubator-nuttx-apps] 02/05: netutils/usrsock_rpmsg: Change to pass the flags to the psock interface

This is an automated email from the ASF dual-hosted git repository.

masayuki pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit c1bf0122111a0192fb6e31eeafd5af43b4f8ef15
Author: SPRESENSE <41...@users.noreply.github.com>
AuthorDate: Thu Aug 6 10:50:56 2020 +0900

    netutils/usrsock_rpmsg: Change to pass the flags to the psock interface
    
    Pass the sendto/recvfrom flags argument to the psock interface.
---
 netutils/usrsock_rpmsg/usrsock_rpmsg_server.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/netutils/usrsock_rpmsg/usrsock_rpmsg_server.c b/netutils/usrsock_rpmsg/usrsock_rpmsg_server.c
index a15f425..6155c46 100644
--- a/netutils/usrsock_rpmsg/usrsock_rpmsg_server.c
+++ b/netutils/usrsock_rpmsg/usrsock_rpmsg_server.c
@@ -348,7 +348,8 @@ static int usrsock_rpmsg_sendto_handler(struct rpmsg_endpoint *ept,
   if (req->usockid >= 0 && req->usockid < CONFIG_NSOCKET_DESCRIPTORS)
     {
       ret = psock_sendto(&priv->socks[req->usockid],
-              (const void *)(req + 1) + req->addrlen, req->buflen, 0,
+              (const void *)(req + 1) + req->addrlen, req->buflen,
+              req->flags,
               req->addrlen ? (const struct sockaddr *)(req + 1) : NULL,
               req->addrlen);
     }
@@ -395,7 +396,7 @@ static int usrsock_rpmsg_recvfrom_handler(struct rpmsg_endpoint *ept,
   if (req->usockid >= 0 && req->usockid < CONFIG_NSOCKET_DESCRIPTORS)
     {
       ret = psock_recvfrom(&priv->socks[req->usockid],
-              (void *)(ack + 1) + inaddrlen, buflen, 0,
+              (void *)(ack + 1) + inaddrlen, buflen, req->flags,
               outaddrlen ? (struct sockaddr *)(ack + 1) : NULL,
               outaddrlen ? &outaddrlen : NULL);
       if (ret > 0 && outaddrlen < inaddrlen)