Set $NAME when calling host-up/down and subnet-up/down scripts.
[tinc] / src / subnet.c
index d7b9f47..7b67352 100644 (file)
@@ -523,7 +523,7 @@ subnet_t *lookup_subnet_ipv6(const ipv6_t *address) {
 void subnet_update(node_t *owner, subnet_t *subnet, bool up) {
        avl_node_t *node;
        int i;
-       char *envp[9] = {NULL};
+       char *envp[10] = {NULL};
        char netstr[MAXNETSTR];
        char *name, *address, *port;
        char empty[] = "";
@@ -544,6 +544,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) {