You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/08/31 14:30:38 UTC
[GitHub] [incubator-nuttx] anchao opened a new pull request, #6974: net/usrsock: forward FIONBIO to socket level
anchao opened a new pull request, #6974:
URL: https://github.com/apache/incubator-nuttx/pull/6974
## Summary
net/usrsock: forward FIONBIO to socket level
fix usrsock nonblock connect test break:
```
apps/examples/usrsocktest/usrsocktest_noblock_connect.c:
...
157 TEST(no_block_connect, delayed_connect)
158 {
...
190 ret = fcntl(sd, F_SETFL, flags | O_NONBLOCK);
...
204 ret = connect(sd, (FAR const struct sockaddr *)&addr, sizeof(addr));
205 TEST_ASSERT_EQUAL(-1, ret);
206 TEST_ASSERT_EQUAL(EINPROGRESS, errno);
```
should goahead to socket level:
```
nuttx/net/netdev/netdev_ioctl.c:
...
1755 int psock_vioctl(FAR struct socket *psock, int cmd, va_list ap)
1756 {
...
1771 ret = netdev_ioctl(psock, cmd, arg);
...
1775 if (ret == -ENOTTY)
1776 {
1777 ret = netdev_file_ioctl(psock, cmd, arg);
1778 }
...
```
Signed-off-by: chao an <an...@xiaomi.com>
## Impact
## Testing
Pass the usrsock test:
https://github.com/apache/incubator-nuttx-apps/blob/master/examples/usrsocktest/usrsocktest_noblock_connect.c#L190-L204
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #6974: net/usrsock: forward FIONBIO to socket level
Posted by GitBox <gi...@apache.org>.
anchao commented on code in PR #6974:
URL: https://github.com/apache/incubator-nuttx/pull/6974#discussion_r960210816
##########
net/usrsock/usrsock_ioctl.c:
##########
@@ -233,6 +234,11 @@ int usrsock_ioctl(FAR struct socket *psock, int cmd, FAR void *arg,
errout_unlock:
net_unlock();
+ if (ret == OK && cmd == FIONBIO)
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6974: net/usrsock: forward FIONBIO to socket level
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #6974:
URL: https://github.com/apache/incubator-nuttx/pull/6974#discussion_r959901903
##########
net/usrsock/usrsock_ioctl.c:
##########
@@ -233,6 +234,11 @@ int usrsock_ioctl(FAR struct socket *psock, int cmd, FAR void *arg,
errout_unlock:
net_unlock();
+ if (ret == OK && cmd == FIONBIO)
Review Comment:
Since the usrsock server always put the socket in nonblocking mode, should we return -ENOTTY at the beginning?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #6974: net/usrsock: forward FIONBIO to socket level
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #6974:
URL: https://github.com/apache/incubator-nuttx/pull/6974
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org