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

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

View File

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