Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions net/socket/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,23 +113,8 @@ int psock_socket(int domain, int type, int protocol, FAR struct socket *psock)
*/

ret = g_usrsock_sockif.si_setup(psock, protocol);
if (ret == -ENETDOWN)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But does this break the dual usrsock / nuttx tcp-stack use-case? Device where connectivity can be configured to use usrsock or nuttx tcp-stack?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean runtime switch between usrsock and real tcp/ip stack instead of compile decision?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, when usrsock daemon not running, try nuttx tcp-stack instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If so, we need revert this patch, but adjust usrsocktest too. Actually, I think many testcase in usrsocktest is too strict to verfiy the errno must equal some specific value. A little internal modification like this will break the testcase.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, usrsocktest errno checking should be more relaxed and allow different error values. Specific error values should only be checked when they are really expected.

{
/* -ENETDOWN means that USRSOCK daemon is not running. Attempt to
* open socket with kernel networking stack.
*/
}
else
{
psock->s_sockif = &g_usrsock_sockif;

if (ret < 0)
{
return ret;
}

return ret;
}
psock->s_sockif = &g_usrsock_sockif;
return ret;
}
#endif /* CONFIG_NET_USRSOCK */

Expand Down
4 changes: 1 addition & 3 deletions net/usrsock/usrsock_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,6 @@ int usrsockdev_do_request(FAR struct usrsock_conn_s *conn,
{
FAR struct usrsockdev_s *dev = conn->dev;
FAR struct usrsock_request_common_s *req_head = iov[0].iov_base;
int ret = OK;

if (!dev)
{
Expand Down Expand Up @@ -1207,7 +1206,6 @@ int usrsockdev_do_request(FAR struct usrsock_conn_s *conn,
{
ninfo("usockid=%d; daemon abruptly closed /dev/usrsock.\n",
conn->usockid);
ret = -ESHUTDOWN;
}

/* Free request line for next command. */
Expand All @@ -1216,7 +1214,7 @@ int usrsockdev_do_request(FAR struct usrsock_conn_s *conn,

--dev->req.nbusy; /* net_lock held. */

return ret;
return OK;
}

/****************************************************************************
Expand Down