hartmannathan commented on code in PR #17520:
URL: https://github.com/apache/nuttx/pull/17520#discussion_r2623849014
##########
net/pkt/pkt_recvmsg.c:
##########
@@ -474,7 +474,7 @@ ssize_t pkt_recvmsg(FAR struct socket *psock, FAR struct
msghdr *msg,
if (psock->s_type != SOCK_RAW)
{
nerr("ERROR: Unsupported socket type: %d\n", psock->s_type);
- ret = -ENOSYS;
+ return -ENOSYS;
Review Comment:
The change does seem reasonable: if the socket type is unsupported then it
seems reasonable that we should not proceed with the rest of the function.
However, I agree that the PR description and commit log need to be updated.
Rather than "Fix coverity issue" I recommend something like:
"net/pkt_recvmsg(): Fix error handling in case of unsupported socket types".
You can include "Found by Coverity" in the PR description and log message.
Also I recommend to update the function's docstring to indicate that psock
must be of type SOCK_RAW. Currently that's not documented.
Have you tested the network code in some way to exercise this code path?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]