diff options
| author | David M. Syzdek <david.syzdek@acsalaska.com> | 2022-07-21 15:43:25 -0800 |
|---|---|---|
| committer | David M. Syzdek <david.syzdek@acsalaska.com> | 2022-07-21 15:43:25 -0800 |
| commit | 7870c807d7fcad9b8632c46170f17c4bd1020b39 (patch) | |
| tree | fc9b1bdfb6febf41b144eb0fa83f93075e8b22b8 /src | |
| parent | 87355226022accb68e7899374fdc07870ad77a35 (diff) | |
| download | akcom-udpecho-7870c807d7fcad9b8632c46170f17c4bd1020b39.tar.gz akcom-udpecho-7870c807d7fcad9b8632c46170f17c4bd1020b39.tar.bz2 akcom-udpecho-7870c807d7fcad9b8632c46170f17c4bd1020b39.tar.xz akcom-udpecho-7870c807d7fcad9b8632c46170f17c4bd1020b39.zip | |
akcom-udpechod: removing excess logging
Diffstat (limited to 'src')
| -rw-r--r-- | src/akcom-udpechod.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/src/akcom-udpechod.c b/src/akcom-udpechod.c index 715d9b1..0163c43 100644 --- a/src/akcom-udpechod.c +++ b/src/akcom-udpechod.c | |||
| @@ -802,12 +802,6 @@ int my_log_conn(int mode, size_t * connp, union my_sa * sap, | |||
| 802 | ); | 802 | ); |
| 803 | }; | 803 | }; |
| 804 | 804 | ||
| 805 | // log if IPv4 address mapped to IPv6 | ||
| 806 | if (sap->ss.ss_family == AF_INET6) | ||
| 807 | if (mode == MY_RECV) | ||
| 808 | if (IN6_IS_ADDR_V4MAPPED(&sap->sin6.sin6_addr) != 0) | ||
| 809 | syslog(LOG_INFO, "conn %zu: client: [%s]:%hu; IPv4 mapped address", *connp, addr_str, port); | ||
| 810 | |||
| 811 | return(0); | 805 | return(0); |
| 812 | } | 806 | } |
| 813 | 807 | ||
| @@ -841,13 +835,11 @@ int my_loop(int s, size_t * connp) | |||
| 841 | (*connp)++; | 835 | (*connp)++; |
| 842 | 836 | ||
| 843 | // read data | 837 | // read data |
| 844 | syslog(LOG_DEBUG, "conn %zu: reading data", *connp); | ||
| 845 | sinlen = sizeof(struct sockaddr_storage); | 838 | sinlen = sizeof(struct sockaddr_storage); |
| 846 | if ((ssize = recvfrom(s, udpbuff.bytes, sizeof(udpbuff), 0, &sa.sa, &sinlen)) == -1) | 839 | if ((ssize = recvfrom(s, udpbuff.bytes, sizeof(udpbuff), 0, &sa.sa, &sinlen)) == -1) |
| 847 | return(-1); | 840 | return(-1); |
| 848 | 841 | ||
| 849 | // grab timestamp | 842 | // grab timestamp |
| 850 | syslog(LOG_DEBUG, "conn %zu: calculating recv timestamp", *connp); | ||
| 851 | clock_gettime(CLOCK_REALTIME, &ts); | 843 | clock_gettime(CLOCK_REALTIME, &ts); |
| 852 | us = (uint64_t)(ts.tv_sec * 1000000); | 844 | us = (uint64_t)(ts.tv_sec * 1000000); |
| 853 | us += (uint64_t)ts.tv_nsec / 1000; | 845 | us += (uint64_t)ts.tv_nsec / 1000; |
| @@ -858,7 +850,6 @@ int my_loop(int s, size_t * connp) | |||
| 858 | // process echo+ packet | 850 | // process echo+ packet |
| 859 | if ((cnf_echoplus)) | 851 | if ((cnf_echoplus)) |
| 860 | { | 852 | { |
| 861 | syslog(LOG_DEBUG, "conn %zu: intializing echo plus header", *connp); | ||
| 862 | udpbuff.msg.res_sn = udpbuff.msg.req_sn; | 853 | udpbuff.msg.res_sn = udpbuff.msg.req_sn; |
| 863 | udpbuff.msg.recv_time = htonl(us & 0xFFFFFFFFLL); | 854 | udpbuff.msg.recv_time = htonl(us & 0xFFFFFFFFLL); |
| 864 | udpbuff.msg.failures = 0; | 855 | udpbuff.msg.failures = 0; |
| @@ -879,12 +870,10 @@ int my_loop(int s, size_t * connp) | |||
| 879 | if (cnf_delay > 0) | 870 | if (cnf_delay > 0) |
| 880 | { | 871 | { |
| 881 | delay = (useconds_t)rand() % cnf_delay; | 872 | delay = (useconds_t)rand() % cnf_delay; |
| 882 | syslog(LOG_DEBUG, "conn %zu: delaying response for %i us", *connp, delay); | ||
| 883 | usleep(delay); | 873 | usleep(delay); |
| 884 | }; | 874 | }; |
| 885 | 875 | ||
| 886 | // grab timestamp | 876 | // grab timestamp |
| 887 | syslog(LOG_DEBUG, "conn %zu: calculating sent timestamp", *connp); | ||
| 888 | clock_gettime(CLOCK_REALTIME, &ts); | 877 | clock_gettime(CLOCK_REALTIME, &ts); |
| 889 | ts.tv_nsec++; | 878 | ts.tv_nsec++; |
| 890 | us = (uint64_t)(ts.tv_sec * 1000000); | 879 | us = (uint64_t)(ts.tv_sec * 1000000); |
| @@ -893,7 +882,6 @@ int my_loop(int s, size_t * connp) | |||
| 893 | // send response | 882 | // send response |
| 894 | if ((cnf_echoplus)) | 883 | if ((cnf_echoplus)) |
| 895 | { | 884 | { |
| 896 | syslog(LOG_DEBUG, "conn %zu: updating echo plus header", *connp); | ||
| 897 | udpbuff.msg.reply_time = htonl(us & 0xFFFFFFFFLL); | 885 | udpbuff.msg.reply_time = htonl(us & 0xFFFFFFFFLL); |
| 898 | }; | 886 | }; |
| 899 | sendto(s, udpbuff.bytes, (size_t)ssize, 0, &sa.sa, sinlen); | 887 | sendto(s, udpbuff.bytes, (size_t)ssize, 0, &sa.sa, sinlen); |
