]> git.meshlink.io Git - meshlink/blobdiff - src/top.c
Fix nodes joining the VPN after tincctl top started.
[meshlink] / src / top.c
index 62c46f5ddcdd556b1a894e9b901734ca4d5247fb..dc1fecf30d9eb7521fbe9ff5398c6b7362443063 100644 (file)
--- a/src/top.c
+++ b/src/top.c
@@ -108,7 +108,9 @@ static void update(int fd) {
                        } else {
                                found = xmalloc_and_zero(sizeof *found);
                                found->name = xstrdup(name);
-                               list_insert_after(&node_list, i, found);
+                               fprintf(stderr, "Inserting %s before %s\n", found->name, node->name);
+                               list_insert_before(&node_list, i, found);
+                               changed = true;
                                break;
                        }
                }
@@ -117,6 +119,7 @@ static void update(int fd) {
                        found = xmalloc_and_zero(sizeof *found);
                        found->name = xstrdup(name);
                        list_insert_tail(&node_list, found);
+                       changed = true;
                }
 
                found->known = true;