subnet-up/down hooks

This commit is contained in:
Guus Sliepen 2004-12-01 20:06:05 +00:00
parent f08baa3072
commit c46f56a8b8
4 changed files with 62 additions and 1 deletions

View file

@ -462,6 +462,10 @@ bool setup_myself(void)
for(i = 0; i < 5; i++)
free(envp[i]);
/* Run subnet-up scripts for our own subnets */
subnet_update(myself, NULL, true);
/* Open sockets */
get_config_string(lookup_config(config_tree, "BindToAddress"), &address);
@ -568,8 +572,10 @@ void close_network_connections(void)
terminate_connection(c, false);
}
if(myself && myself->connection)
if(myself && myself->connection) {
subnet_update(myself, NULL, false);
terminate_connection(myself->connection, false);
}
for(i = 0; i < listen_sockets; i++) {
close(listen_socket[i].tcp);