summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2020-06-15 12:15:57 +0300
committerTom Rini <trini@konsulko.com>2020-08-05 06:30:02 +0300
commitdef7a5c00f4a84edf7a8a83c28bf9a7063e00731 (patch)
tree4bc2f19aa2c20fc43bc5046c31eca8a590025227 /net
parenta08f2f7b944f6926843b26a216db58b8d02a19e1 (diff)
downloadu-boot-def7a5c00f4a84edf7a8a83c28bf9a7063e00731.tar.xz
net: ping: reset stored IP address
Reset the stored ping IP address before entering a netloop with different protocol to ensure that it won't be interrupted by the received correct ICMP_ECHO_REPLY packet. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Diffstat (limited to 'net')
-rw-r--r--net/net.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/net.c b/net/net.c
index 1e7f633cb6..28d9eebf9d 100644
--- a/net/net.c
+++ b/net/net.c
@@ -409,6 +409,10 @@ int net_loop(enum proto_t protocol)
int ret = -EINVAL;
enum net_loop_state prev_net_state = net_state;
+#if defined(CONFIG_CMD_PING)
+ if (protocol != PING)
+ net_ping_ip.s_addr = 0;
+#endif
net_restarted = 0;
net_dev_exists = 0;
net_try_count = 1;