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/04/27 09:36:09 UTC

[GitHub] [incubator-nuttx] michi-jung opened a new pull request, #6161: Fix udp recvfrom to correctly return addrlen

michi-jung opened a new pull request, #6161:
URL: https://github.com/apache/incubator-nuttx/pull/6161

   ## Summary
   
   According to POSIX the length of the source address of the received
   message shall be stored in the object pointed to by the address_len
   argument.
   
   This patch fixes two places where this did not happen correctly.
   
   Signed-off-by: Michael Jung <mi...@secore.ly>
   
   
   ## Impact
   
   None
   
   ## Testing
   
   Tested on B-U585I-IOT02A with a ENC28J60 SPI attached Ethernet MAC.  Fixes problems with Wakamaa LwM2M demos.
   


-- 
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 #6161: Fix udp recvfrom to correctly return addrlen

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #6161:
URL: https://github.com/apache/incubator-nuttx/pull/6161


-- 
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] michi-jung commented on a diff in pull request #6161: Fix udp recvfrom to correctly return addrlen

Posted by GitBox <gi...@apache.org>.
michi-jung commented on code in PR #6161:
URL: https://github.com/apache/incubator-nuttx/pull/6161#discussion_r860578232


##########
net/udp/udp_recvfrom.c:
##########
@@ -244,6 +244,7 @@ static inline void udp_readahead(struct udp_recvfrom_s *pstate)
           pstate->ir_recvlen  = recvlen;
           pstate->ir_buffer  += recvlen;
           pstate->ir_buflen  -= recvlen;
+          *pstate->ir_fromlen = (socklen_t)src_addr_size;

Review Comment:
   I removed the cast and it still compiles warning free. Thanks!



-- 
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] pkarashchenko commented on a diff in pull request #6161: Fix udp recvfrom to correctly return addrlen

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #6161:
URL: https://github.com/apache/incubator-nuttx/pull/6161#discussion_r859632311


##########
net/udp/udp_recvfrom.c:
##########
@@ -351,11 +352,13 @@ static inline void udp_sender(FAR struct net_driver_s *dev,
           else
 #endif
             {
+              FAR socklen_t *fromlen = pstate->ir_fromlen;

Review Comment:
   maybe we can have this defined at line 324. I mean define it once and clean-up `if (conn->domain == PF_INET6)` and `else` case?



-- 
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] michi-jung commented on pull request #6161: Fix udp recvfrom to correctly return addrlen

Posted by GitBox <gi...@apache.org>.
michi-jung commented on PR #6161:
URL: https://github.com/apache/incubator-nuttx/pull/6161#issuecomment-1111851530

   @pkarashchenko and @xiaoxiang781216: Thanks for you review.  I think I addressed your comments.  Please have a look.


-- 
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] michi-jung commented on a diff in pull request #6161: Fix udp recvfrom to correctly return addrlen

Posted by GitBox <gi...@apache.org>.
michi-jung commented on code in PR #6161:
URL: https://github.com/apache/incubator-nuttx/pull/6161#discussion_r860577855


##########
net/udp/udp_recvfrom.c:
##########
@@ -351,11 +352,13 @@ static inline void udp_sender(FAR struct net_driver_s *dev,
           else
 #endif
             {
+              FAR socklen_t *fromlen = pstate->ir_fromlen;

Review Comment:
   Ok, did this. Thanks.



-- 
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 #6161: Fix udp recvfrom to correctly return addrlen

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #6161:
URL: https://github.com/apache/incubator-nuttx/pull/6161#discussion_r859883177


##########
net/udp/udp_recvfrom.c:
##########
@@ -244,6 +244,7 @@ static inline void udp_readahead(struct udp_recvfrom_s *pstate)
           pstate->ir_recvlen  = recvlen;
           pstate->ir_buffer  += recvlen;
           pstate->ir_buflen  -= recvlen;
+          *pstate->ir_fromlen = (socklen_t)src_addr_size;

Review Comment:
   don't need cast?



-- 
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