X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Finfo.c;h=1649be065bb370a4ec00a60d38b766771ab07814;hb=ac2a1722b71e98010324ed46235e96bfa6e672f5;hp=4ca67ec4fd8a60c2e3502d2b730f60e829b78e85;hpb=70e1e467f93f885da3e49289e96757d5cd2ae5ba;p=tinc diff --git a/src/info.c b/src/info.c index 4ca67ec4..1649be06 100644 --- a/src/info.c +++ b/src/info.c @@ -20,23 +20,25 @@ #include "system.h" #include "control_common.h" -#include "list.h" #include "subnet.h" #include "tincctl.h" #include "info.h" #include "utils.h" -#include "xalloc.h" void logger(int level, int priority, const char *format, ...) { + (void)level; + (void)priority; va_list ap; + va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap); + fputc('\n', stderr); } char *strip_weight(char *netstr) { - int len = strlen(netstr); + size_t len = strlen(netstr); if(len >= 3 && !strcmp(netstr + len - 3, "#10")) { netstr[len - 3] = 0; @@ -145,8 +147,6 @@ static int info_node(int fd, const char *item) { if(status.udp_confirmed) { printf(" udp_confirmed"); - if(udp_ping_rtt != -1) - printf(" (rtt %ld.%03ld)", udp_ping_rtt / 1000, udp_ping_rtt % 1000); } printf("\n"); @@ -183,6 +183,10 @@ static int info_node(int fd, const char *item) { printf("unknown\n"); } else if(minmtu > 0) { printf("directly with UDP\nPMTU: %d\n", pmtu); + + if(udp_ping_rtt != -1) { + printf("RTT: %d.%03d\n", udp_ping_rtt / 1000, udp_ping_rtt % 1000); + } } else if(!strcmp(nexthop, item)) { printf("directly with TCP\n"); } else {