aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/akcom-udpechod.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/akcom-udpechod.c b/src/akcom-udpechod.c
index 0163c43..701bc47 100644
--- a/src/akcom-udpechod.c
+++ b/src/akcom-udpechod.c
@@ -813,7 +813,8 @@ int my_loop(int s, size_t * connp)
813 ssize_t ssize; 813 ssize_t ssize;
814 useconds_t delay; 814 useconds_t delay;
815 struct timespec ts; 815 struct timespec ts;
816 uint64_t us; 816 uint64_t us_recv;
817 uint64_t us_reply;
817 struct pollfd fds[2]; 818 struct pollfd fds[2];
818 union my_sa sa; 819 union my_sa sa;
819 union 820 union
@@ -841,8 +842,8 @@ int my_loop(int s, size_t * connp)
841 842
842 // grab timestamp 843 // grab timestamp
843 clock_gettime(CLOCK_REALTIME, &ts); 844 clock_gettime(CLOCK_REALTIME, &ts);
844 us = (uint64_t)(ts.tv_sec * 1000000); 845 us_recv = (uint64_t)(ts.tv_sec * 1000000);
845 us += (uint64_t)ts.tv_nsec / 1000; 846 us_recv += (uint64_t)ts.tv_nsec / 1000;
846 847
847 // log connection 848 // log connection
848 my_log_conn(MY_RECV, connp, &sa, &udpbuff.msg, ssize, &ts, 0); 849 my_log_conn(MY_RECV, connp, &sa, &udpbuff.msg, ssize, &ts, 0);
@@ -851,7 +852,7 @@ int my_loop(int s, size_t * connp)
851 if ((cnf_echoplus)) 852 if ((cnf_echoplus))
852 { 853 {
853 udpbuff.msg.res_sn = udpbuff.msg.req_sn; 854 udpbuff.msg.res_sn = udpbuff.msg.req_sn;
854 udpbuff.msg.recv_time = htonl(us & 0xFFFFFFFFLL); 855 udpbuff.msg.recv_time = htonl(us_recv & 0xFFFFFFFFLL);
855 udpbuff.msg.failures = 0; 856 udpbuff.msg.failures = 0;
856 }; 857 };
857 858
@@ -876,13 +877,13 @@ int my_loop(int s, size_t * connp)
876 // grab timestamp 877 // grab timestamp
877 clock_gettime(CLOCK_REALTIME, &ts); 878 clock_gettime(CLOCK_REALTIME, &ts);
878 ts.tv_nsec++; 879 ts.tv_nsec++;
879 us = (uint64_t)(ts.tv_sec * 1000000); 880 us_reply = (uint64_t)(ts.tv_sec * 1000000);
880 us += (uint64_t)ts.tv_nsec / 1000; 881 us_reply += (uint64_t)ts.tv_nsec / 1000;
881 882
882 // send response 883 // send response
883 if ((cnf_echoplus)) 884 if ((cnf_echoplus))
884 { 885 {
885 udpbuff.msg.reply_time = htonl(us & 0xFFFFFFFFLL); 886 udpbuff.msg.reply_time = htonl(us_reply & 0xFFFFFFFFLL);
886 }; 887 };
887 sendto(s, udpbuff.bytes, (size_t)ssize, 0, &sa.sa, sinlen); 888 sendto(s, udpbuff.bytes, (size_t)ssize, 0, &sa.sa, sinlen);
888 889