]> git.meshlink.io Git - meshlink/blobdiff - src/graph.c
Remove files not used by MeshLink.
[meshlink] / src / graph.c
index 302056a312f786cdf5303e99f5930e8d0846b66f..75996eacdd26a8539fecc9166137822d495fdc2f 100644 (file)
@@ -45,7 +45,6 @@
 #include "system.h"
 
 #include "connection.h"
-#include "device.h"
 #include "edge.h"
 #include "graph.h"
 #include "list.h"
@@ -53,8 +52,8 @@
 #include "names.h"
 #include "netutl.h"
 #include "node.h"
-#include "process.h"
 #include "protocol.h"
+#include "script.h"
 #include "subnet.h"
 #include "utils.h"
 #include "xalloc.h"
@@ -235,16 +234,14 @@ static void check_reachability(void) {
                        char *name;
                        char *address;
                        char *port;
-                       char *envp[7];
+                       char *envp[8] = {NULL};
 
                        xasprintf(&envp[0], "NETNAME=%s", netname ? : "");
-                       xasprintf(&envp[1], "DEVICE=%s", device ? : "");
-                       xasprintf(&envp[2], "INTERFACE=%s", iface ? : "");
                        xasprintf(&envp[3], "NODE=%s", n->name);
                        sockaddr2str(&n->address, &address, &port);
                        xasprintf(&envp[4], "REMOTEADDRESS=%s", address);
                        xasprintf(&envp[5], "REMOTEPORT=%s", port);
-                       envp[6] = NULL;
+                       xasprintf(&envp[6], "NAME=%s", myself->name);
 
                        execute_script(n->status.reachable ? "host-up" : "host-down", envp);
 
@@ -255,7 +252,7 @@ static void check_reachability(void) {
                        free(address);
                        free(port);
 
-                       for(int i = 0; i < 6; i++)
+                       for(int i = 0; i < 7; i++)
                                free(envp[i]);
 
                        subnet_update(n, NULL, n->status.reachable);