projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3c163a3
)
Use read_host_config() where appropriate.
author
Guus Sliepen
<guus@tinc-vpn.org>
Sat, 11 May 2013 12:05:28 +0000
(14:05 +0200)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Sat, 11 May 2013 12:05:28 +0000
(14:05 +0200)
src/net.c
patch
|
blob
|
history
src/net_setup.c
patch
|
blob
|
history
diff --git
a/src/net.c
b/src/net.c
index
d2eacf3
..
8a63615
100644
(file)
--- a/
src/net.c
+++ b/
src/net.c
@@
-306,7
+306,7
@@
static void sigalrm_handler(void *data) {
#endif
int reload_configuration(void) {
#endif
int reload_configuration(void) {
- char *fname;
+ char *fname
= NULL
;
/* Reread our own configuration file */
/* Reread our own configuration file */
diff --git
a/src/net_setup.c
b/src/net_setup.c
index
34d8980
..
cb14c51
100644
(file)
--- a/
src/net_setup.c
+++ b/
src/net_setup.c
@@
-63,13
+63,11
@@
bool node_read_ecdsa_public_key(node_t *n) {
splay_tree_t *config_tree;
FILE *fp;
splay_tree_t *config_tree;
FILE *fp;
- char *pubname = NULL
, *hcfname = NULL
;
+ char *pubname = NULL;
char *p;
char *p;
- xasprintf(&hcfname, "%s" SLASH "hosts" SLASH "%s", confbase, n->name);
-
init_configuration(&config_tree);
init_configuration(&config_tree);
- if(!read_
config_file(config_tree, hcf
name))
+ if(!read_
host_config(config_tree, n->
name))
goto exit;
/* First, check for simple ECDSAPublicKey statement */
goto exit;
/* First, check for simple ECDSAPublicKey statement */
@@
-97,7
+95,6
@@
bool node_read_ecdsa_public_key(node_t *n) {
exit:
exit_configuration(&config_tree);
exit:
exit_configuration(&config_tree);
- free(hcfname);
free(pubname);
return n->ecdsa;
}
free(pubname);
return n->ecdsa;
}
@@
-319,14
+316,10
@@
void load_all_subnets(void) {
// continue;
#endif
// continue;
#endif
- char *fname;
- xasprintf(&fname, "%s" SLASH "hosts" SLASH "%s", confbase, ent->d_name);
-
splay_tree_t *config_tree;
init_configuration(&config_tree);
read_config_options(config_tree, ent->d_name);
splay_tree_t *config_tree;
init_configuration(&config_tree);
read_config_options(config_tree, ent->d_name);
- read_config_file(config_tree, fname);
- free(fname);
+ read_host_config(config_tree, ent->d_name);
if(!n) {
n = new_node();
if(!n) {
n = new_node();
@@
-618,7
+611,6
@@
bool setup_myself_reloadable(void) {
*/
static bool setup_myself(void) {
char *name, *hostname, *cipher, *digest, *type;
*/
static bool setup_myself(void) {
char *name, *hostname, *cipher, *digest, *type;
- char *fname = NULL;
char *address = NULL;
if(!(name = get_name())) {
char *address = NULL;
if(!(name = get_name())) {
@@
-630,10
+622,7
@@
static bool setup_myself(void) {
myself->connection = new_connection();
myself->name = name;
myself->connection->name = xstrdup(name);
myself->connection = new_connection();
myself->name = name;
myself->connection->name = xstrdup(name);
- xasprintf(&fname, "%s" SLASH "hosts" SLASH "%s", confbase, name);
- read_config_options(config_tree, name);
- read_config_file(config_tree, fname);
- free(fname);
+ read_host_config(config_tree, name);
if(!get_config_string(lookup_config(config_tree, "Port"), &myport))
myport = xstrdup("655");
if(!get_config_string(lookup_config(config_tree, "Port"), &myport))
myport = xstrdup("655");