X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fgraph.c;h=b4c01bb5ef8b2ec36e660ffd05ec0428c82c18fc;hb=54127996ca4156668b6c7df3bb5d8f952dc598ad;hp=45063795893e7789b586f4dd61577915c7aa98af;hpb=4c30004cb6dc23616d7295b0ce631f066e7f1f82;p=tinc diff --git a/src/graph.c b/src/graph.c index 45063795..b4c01bb5 100644 --- a/src/graph.c +++ b/src/graph.c @@ -44,7 +44,6 @@ #include "system.h" -#include "config.h" #include "connection.h" #include "device.h" #include "edge.h" @@ -236,7 +235,7 @@ 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 ? : ""); @@ -245,7 +244,7 @@ static void check_reachability(void) { 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); @@ -256,7 +255,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);