1
0
forked from bip/bip

Give up loading invalid configurations.

Bip does not know how to deal with a network with no server. Simply
prevent loading such bad configs.
Fixes: https://projects.duckcorp.org/issues/611
This commit is contained in:
Arnaud Cornet 2018-12-11 19:37:36 -05:00
parent 09053fc5f0
commit 16f2be6ac2

View File

@ -345,6 +345,14 @@ static int add_network(bip_t *bip, list_t *data)
n->ciphers = conf_server_default_ciphers;
}
#endif
if (n->serverc == 0) {
hash_remove_if_exists(&bip->networks, name);
free(n->name);
free(n);
conf_die(bip, "No sever in network: %s", n->name);
n = NULL;
return 0;
}
return 1;
}