Reset stored ping IP address before leaving the netloop to ensure that the subsequent calls
to the netloop, especially for the other protocols, won't be interrupted by the received
ICMP_ECHO_REPLY packet.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I0d90b3a6e9481c8e8237874eff8a9a12df4190e0
static void ping_timeout_handler(void)
{
eth_halt();
+ net_ping_ip.s_addr = 0;
net_set_state(NETLOOP_FAIL); /* we did not get the reply */
}
switch (icmph->type) {
case ICMP_ECHO_REPLY:
src_ip = net_read_ip((void *)&ip->ip_src);
- if (src_ip.s_addr == net_ping_ip.s_addr)
+ if (src_ip.s_addr == net_ping_ip.s_addr) {
+ net_ping_ip.s_addr = 0;
net_set_state(NETLOOP_SUCCESS);
+ }
return;
case ICMP_ECHO_REQUEST:
eth_hdr_size = net_update_ether(et, et->et_src, PROT_IP);