diff --git a/net/icmp/icmp_recvmsg.c b/net/icmp/icmp_recvmsg.c index 80c1ab88d3..4f2577d97e 100644 --- a/net/icmp/icmp_recvmsg.c +++ b/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; goto end_wait; } diff --git a/net/icmpv6/icmpv6_recvmsg.c b/net/icmpv6/icmpv6_recvmsg.c index b4fb7c80d2..a4678e8f69 100644 --- a/net/icmpv6/icmpv6_recvmsg.c +++ b/net/icmpv6/icmpv6_recvmsg.c @@ -188,7 +188,8 @@ static uint16_t recvfrom_eventhandler(FAR struct net_driver_s *dev, /* Indicate that the data has been consumed */ - flags &= ~ICMPv6_NEWDATA; + flags &= ~ICMPv6_NEWDATA; + dev->d_len = 0; goto end_wait; }