Add local address information to edges.
[tinc] / src / tincctl.c
index da66c8f..18fc05a 100644 (file)
@@ -985,6 +985,8 @@ static int cmd_dump(int argc, char *argv[]) {
                char subnet[4096];
                char host[4096];
                char port[4096];
+               char local_host[4096];
+               char local_port[4096];
                char via[4096];
                char nexthop[4096];
                int cipher, digest, maclength, compression, distance, socket, weight;
@@ -1025,8 +1027,8 @@ static int cmd_dump(int argc, char *argv[]) {
                        } break;
 
                        case REQ_DUMP_EDGES: {
-                               int n = sscanf(line, "%*d %*d %s %s %s port %s %x %d", from, to, host, port, &options, &weight);
-                               if(n != 6) {
+                               int n = sscanf(line, "%*d %*d %s %s %s port %s %s port %s %x %d", from, to, host, port, local_host, local_port, &options, &weight);
+                               if(n != 8) {
                                        fprintf(stderr, "Unable to parse edge dump from tincd.\n");
                                        return 1;
                                }
@@ -1038,7 +1040,7 @@ static int cmd_dump(int argc, char *argv[]) {
                                        else if(do_graph == 2)
                                                printf(" %s -> %s [w = %f, weight = %f];\n", node1, node2, w, w);
                                } else {
-                                       printf("%s to %s at %s port %s options %x weight %d\n", from, to, host, port, options, weight);
+                                       printf("%s to %s at %s port %s local %s port %s options %x weight %d\n", from, to, host, port, local_host, local_port, options, weight);
                                }
                        } break;