]> git.gsnw.org Git - fping.git/commitdiff
Chane ICMP Timestamp format when per_recv_flag true
authorGerman Service Network <support@gsnw.de>
Sun, 13 Oct 2024 21:00:51 +0000 (23:00 +0200)
committerSebastian <176771227+gsnw-sebast@users.noreply.github.com>
Mon, 11 Nov 2024 10:58:22 +0000 (11:58 +0100)
ci/test-05-options-c-e.pl
src/fping.c

index f8ca25aadc82a2983444b326523a31d7c921eea3..fc1d387e695a87701ecc6b268611a6aa7b75629b 100755 (executable)
@@ -84,12 +84,8 @@ if($^O eq 'darwin') {
 }
 my $cmd = Test::Command->new(cmd => "fping -4 --icmp-timestamp -c 2 127.0.0.1");
 $cmd->exit_is_num(0);
-$cmd->stdout_like(qr{127\.0\.0\.1 : \[0\], 20 bytes, \d\.\d+ ms \(\d\.\d+ avg, 0% loss\)
-ICMP timestamp: Originate=\d+ Receive=\d+ Transmit=\d+
-ICMP timestamp RTT tsrtt=\d+
-127\.0\.0\.1 : \[1\], 20 bytes, \d\.\d+ ms \(\d\.\d+ avg, 0% loss\)
-ICMP timestamp: Originate=\d+ Receive=\d+ Transmit=\d+
-ICMP timestamp RTT tsrtt=\d+
+$cmd->stdout_like(qr{127\.0\.0\.1 : \[0\], 20 bytes, \d\.\d+ ms \(\d\.\d+ avg, 0% loss\), ICMP timestamp: Originate=\d+ Receive=\d+ Transmit=\d+
+127\.0\.0\.1 : \[1\], 20 bytes, \d\.\d+ ms \(\d\.\d+ avg, 0% loss\), ICMP timestamp: Originate=\d+ Receive=\d+ Transmit=\d+
 });
 
 $cmd->stderr_like(qr{127\.0\.0\.1 : xmt/rcv/%loss = 2/2/0%, min/avg/max = \d\.\d+/\d\.\d+/\d\.\d+
index 569a04d569ed0d936fe8fa2b894dbf040d903fa5..55dabef37483cab3053dcc44a8c09465fc60998a 100644 (file)
@@ -2404,7 +2404,6 @@ int wait_for_reply(int64_t wait_time)
     long ip_header_otime_ms = -1;
     long ip_header_rtime_ms = -1;
     long ip_header_ttime_ms = -1;
-    int tsrtt;
 
     /* Receive packet */
     result = receive_packet(wait_time, /* max. wait time, in ns */
@@ -2610,18 +2609,16 @@ int wait_for_reply(int64_t wait_time)
             fprintf(stderr, " [<- %s]", buf);
         }
 
-        printf("\n");
-
         if (icmp_request_typ == 13) {
             if(ip_header_otime_ms != -1 && ip_header_rtime_ms != -1 && ip_header_ttime_ms != -1) {
-                printf("ICMP timestamp: Originate=%lu Receive=%lu Transmit=%lu\n", ip_header_otime_ms, ip_header_rtime_ms, ip_header_ttime_ms);
-                tsrtt = (ip_header_ttime_ms - ip_header_otime_ms) + (this_reply - (ip_header_rtime_ms - ip_header_otime_ms));
-                printf("ICMP timestamp RTT tsrtt=%d\n", tsrtt);
+                printf(", ICMP timestamp: Originate=%lu Receive=%lu Transmit=%lu", ip_header_otime_ms, ip_header_rtime_ms, ip_header_ttime_ms);
             }
             else {
-                printf("ICMP timestamp: unknown\n");
+                printf(", ICMP timestamp: unknown");
             }
         }
+
+        printf("\n");
     }
 
     return 1;