dlizewski commented on code in PR #11107: URL: https://github.com/apache/nuttx/pull/11107#discussion_r1379343508
########## net/socket/socket.c: ########## @@ -104,9 +104,11 @@ int psock_socket(int domain, int type, int protocol, /* When usrsock daemon returns -ENOSYS or -ENOTSUP, it means to use * kernel's network stack, so fallback to kernel socket. + * When -ENETDOWN is returned, it means the usrsock daemon was never + * launched or is no longer running, so fallback to kernel socket. */ - if (ret == 0 || (ret != -ENOSYS && ret != -ENOTSUP)) + if (ret == 0 || (ret != -ENOSYS && ret != -ENOTSUP && ret != -ENETDOWN)) Review Comment: Thanks. I has missed that. There was a test which aborted the daemon and was checking to see ENETDOWN. I propagated the original return code of usrsock if it tired to fallback to kernel but the kernel doesn't have any sockets of that type compiled in. Which is what the behaviour would have been before #9647 when it used to only use usrsock if the kernel didnt provide a socket of that family. The other option was to keep the shutdown test but remove the check for ENETDOWN, but that felt like a reduciton of testing scope. ########## net/socket/socket.c: ########## @@ -104,9 +104,11 @@ int psock_socket(int domain, int type, int protocol, /* When usrsock daemon returns -ENOSYS or -ENOTSUP, it means to use * kernel's network stack, so fallback to kernel socket. + * When -ENETDOWN is returned, it means the usrsock daemon was never + * launched or is no longer running, so fallback to kernel socket. */ - if (ret == 0 || (ret != -ENOSYS && ret != -ENOTSUP)) + if (ret == 0 || (ret != -ENOSYS && ret != -ENOTSUP && ret != -ENETDOWN)) Review Comment: Thanks. I had missed that. There was a test which aborted the daemon and was checking to see ENETDOWN. I propagated the original return code of usrsock if it tired to fallback to kernel but the kernel doesn't have any sockets of that type compiled in. Which is what the behaviour would have been before #9647 when it used to only use usrsock if the kernel didnt provide a socket of that family. The other option was to keep the shutdown test but remove the check for ENETDOWN, but that felt like a reduciton of testing scope. -- 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org