net/icmp: consume the data length to avoid duplicate packet

Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
chao.an 2021-05-18 21:10:03 +08:00 committed by Xiang Xiao
parent b0ac97adab
commit 9c1fb4c04b
2 changed files with 4 additions and 2 deletions

View File

@ -181,7 +181,8 @@ static uint16_t recvfrom_eventhandler(FAR struct net_driver_s *dev,
/* Indicate that the data has been consumed */ /* Indicate that the data has been consumed */
flags &= ~ICMP_NEWDATA; flags &= ~ICMP_NEWDATA;
dev->d_len = 0;
goto end_wait; goto end_wait;
} }

View File

@ -188,7 +188,8 @@ static uint16_t recvfrom_eventhandler(FAR struct net_driver_s *dev,
/* Indicate that the data has been consumed */ /* Indicate that the data has been consumed */
flags &= ~ICMPv6_NEWDATA; flags &= ~ICMPv6_NEWDATA;
dev->d_len = 0;
goto end_wait; goto end_wait;
} }