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 2021/06/07 07:32:56 UTC

[GitHub] [incubator-nuttx] anchao commented on a change in pull request #3755: net/icmp: icmp bug fix and enhancement

anchao commented on a change in pull request #3755:
URL: https://github.com/apache/incubator-nuttx/pull/3755#discussion_r646338066



##########
File path: net/icmp/icmp_recvmsg.c
##########
@@ -181,7 +181,8 @@ static uint16_t recvfrom_eventhandler(FAR struct net_driver_s *dev,
 
           /* Indicate that the data has been consumed */
 
-          flags &= ~ICMP_NEWDATA;
+          flags     &= ~ICMP_NEWDATA;
+          dev->d_len = 0;

Review comment:
       Hi, @antmerlino 
   
   This change follows the logic of other protocol stacks, d_Len should be set to 0 if the buffer is consumed
   https://github.com/apache/incubator-nuttx/blob/3859031a6bfdc987b6704f5460762e91e8d84b8e/net/tcp/tcp_recvfrom.c#L215
   
   https://github.com/apache/incubator-nuttx/blob/3859031a6bfdc987b6704f5460762e91e8d84b8e/net/udp/udp_recvfrom.c#L179




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org