From 224c71f8d01528d649b2c8522be5ab9cabf4edc4 Mon Sep 17 00:00:00 2001 From: adynis Date: Wed, 18 Mar 2020 01:59:42 +0200 Subject: [PATCH] Improve getting IP address Resolving issue 10 --- ping.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ping.cpp b/ping.cpp index 11ef1ae..79db52f 100644 --- a/ping.cpp +++ b/ping.cpp @@ -168,11 +168,8 @@ static void ping_recv(int s) { // Register end time gettimeofday(&end, NULL); - /// Get from IP address - ip4_addr_t fromaddr; - inet_addr_to_ip4addr(&fromaddr, &from.sin_addr); - - strcpy(ipa, inet_ntoa(fromaddr)); + // Get from IP address + strcpy(ipa, inet_ntoa(from.sin_addr)); // Get echo iphdr = (struct ip_hdr *)buf;