From: Guus Sliepen Date: Mon, 6 Feb 2006 12:30:51 +0000 (+0000) Subject: Make sure $NAME is set correctly when executing tinc-down script. X-Git-Tag: import-tinc-1.1~724 X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=a90f1b652c0fb52950f3b0783a7e2b7f2e0cf2db;p=meshlink Make sure $NAME is set correctly when executing tinc-down script. --- diff --git a/src/net_setup.c b/src/net_setup.c index 3847b346..e0f15696 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -588,6 +588,12 @@ void close_network_connections(void) close(listen_socket[i].udp); } + asprintf(&envp[0], "NETNAME=%s", netname ? : ""); + asprintf(&envp[1], "DEVICE=%s", device ? : ""); + asprintf(&envp[2], "INTERFACE=%s", iface ? : ""); + asprintf(&envp[3], "NAME=%s", myself->name); + envp[4] = NULL; + exit_requests(); exit_events(); exit_edges(); @@ -595,12 +601,6 @@ void close_network_connections(void) exit_nodes(); exit_connections(); - asprintf(&envp[0], "NETNAME=%s", netname ? : ""); - asprintf(&envp[1], "DEVICE=%s", device ? : ""); - asprintf(&envp[2], "INTERFACE=%s", iface ? : ""); - asprintf(&envp[3], "NAME=%s", myself->name); - envp[4] = NULL; - execute_script("tinc-down", envp); for(i = 0; i < 4; i++)