X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Finfo.c;h=eb0d395aac978350632ceaa88ea3f176e648eae6;hb=153abaa4d940bf2bc9bd7275d5efe5c01c354190;hp=f354f96feb4bb114e65a5981e0a5a30264cb8349;hpb=74646a4afa6557a0363cc85e0a95d578d4ab0ac2;p=tinc diff --git a/src/info.c b/src/info.c index f354f96f..eb0d395a 100644 --- a/src/info.c +++ b/src/info.c @@ -33,6 +33,13 @@ void logger(int level, int priority, const char *format, ...) { va_end(ap); } +static char *strip_weight(char *netstr) { + int len = strlen(netstr); + if(len >= 3 && !strcmp(netstr + len - 3, "#10")) + netstr[len - 3] = 0; + return netstr; +} + static int info_node(int fd, const char *item) { // Check the list of nodes sendline(fd, "%d %d %s", CONTROL, REQ_DUMP_NODES, item); @@ -97,8 +104,6 @@ static int info_node(int fd, const char *item) { printf(" reachable"); if(status.indirect) printf(" indirect"); - if(status.ecdh) - printf(" ecdh"); printf("\n"); printf("Options: "); if(options & OPTION_INDIRECT) @@ -110,6 +115,7 @@ static int info_node(int fd, const char *item) { if(options & OPTION_CLAMP_MSS) printf(" clamp_mss"); printf("\n"); + printf("Protocol: %d.%d\n", PROT_MAJOR, OPTION_VERSION(options)); printf("Reachability: "); if(!*port) printf("can reach itself\n"); @@ -154,7 +160,7 @@ static int info_node(int fd, const char *item) { return 1; } if(!strcmp(from, item)) - printf(" %s", subnet); + printf(" %s", strip_weight(subnet)); } printf("\n"); @@ -224,7 +230,7 @@ static int info_subnet(int fd, const char *item) { } found = true; - printf("Subnet: %s\n", netstr); + printf("Subnet: %s\n", strip_weight(netstr)); printf("Owner: %s\n", owner); }