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
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue