net/icmp: consume the data length to avoid duplicate packet
Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
parent
b0ac97adab
commit
9c1fb4c04b
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user