X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fsubnet.c;h=3b980303e88509f67b610da486d279c60fa3efa5;hb=2eba7933053d7d21bf82e647978ee90abe98dc3a;hp=bf4300e4d9ad494a3eaf1054d63e139a324fbb50;hpb=5b07039b0712bee0f19749d63116a10fb08a2d8b;p=tinc diff --git a/src/subnet.c b/src/subnet.c index bf4300e4..3b980303 100644 --- a/src/subnet.c +++ b/src/subnet.c @@ -204,7 +204,7 @@ void subnet_update(node_t *owner, subnet_t *subnet, bool up) { // Prepare environment variables to be passed to the script - char *envp[9] = {NULL}; + char *envp[10] = {NULL}; xasprintf(&envp[0], "NETNAME=%s", netname ? : ""); xasprintf(&envp[1], "DEVICE=%s", device ? : ""); xasprintf(&envp[2], "INTERFACE=%s", iface ? : ""); @@ -219,6 +219,8 @@ void subnet_update(node_t *owner, subnet_t *subnet, bool up) { free(address); } + xasprintf(&envp[8], "NAME=%s", myself->name); + name = up ? "subnet-up" : "subnet-down"; if(!subnet) { @@ -260,7 +262,7 @@ void subnet_update(node_t *owner, subnet_t *subnet, bool up) { } } - for(int i = 0; envp[i] && i < 8; i++) + for(int i = 0; envp[i] && i < 9; i++) free(envp[i]); }