projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
74646a4
)
Strip default subnet weight from output.
author
Guus Sliepen
<guus@tinc-vpn.org>
Sun, 15 Jul 2012 23:14:08 +0000
(
01:14
+0200)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Sun, 15 Jul 2012 23:14:08 +0000
(
01:14
+0200)
src/info.c
patch
|
blob
|
history
diff --git
a/src/info.c
b/src/info.c
index
f354f96
..
6d0435f
100644
(file)
--- a/
src/info.c
+++ b/
src/info.c
@@
-33,6
+33,13
@@
void logger(int level, int priority, const char *format, ...) {
va_end(ap);
}
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);
static int info_node(int fd, const char *item) {
// Check the list of nodes
sendline(fd, "%d %d %s", CONTROL, REQ_DUMP_NODES, item);
@@
-154,7
+161,7
@@
static int info_node(int fd, const char *item) {
return 1;
}
if(!strcmp(from, item))
return 1;
}
if(!strcmp(from, item))
- printf(" %s", s
ubnet
);
+ printf(" %s", s
trip_weight(subnet)
);
}
printf("\n");
}
printf("\n");
@@
-224,7
+231,7
@@
static int info_subnet(int fd, const char *item) {
}
found = true;
}
found = true;
- printf("Subnet: %s\n",
netstr
);
+ printf("Subnet: %s\n",
strip_weight(netstr)
);
printf("Owner: %s\n", owner);
}
printf("Owner: %s\n", owner);
}