X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Finfo.c;h=1649be065bb370a4ec00a60d38b766771ab07814;hb=914d1be411229c28e6e8e4a0df99afa076a8b448;hp=f0dce8c66c860dc0866a2ecf202f5f0550fb0fe8;hpb=22ae0c3549628739ca7c40e48ce1a276469ded92;p=tinc diff --git a/src/info.c b/src/info.c index f0dce8c6..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,10 +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 %d.%03d)", udp_ping_rtt / 1000, udp_ping_rtt % 1000); - } } printf("\n"); @@ -185,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 {