projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
setup_outgoing_connection: log to LOG_DEBUG on if no known address
[tinc]
/
src
/
net_setup.c
diff --git
a/src/net_setup.c
b/src/net_setup.c
index
3c66c13
..
bf5ba04
100644
(file)
--- a/
src/net_setup.c
+++ b/
src/net_setup.c
@@
-1,7
+1,7
@@
/*
net_setup.c -- Setup.
Copyright (C) 1998-2005 Ivo Timmermans,
/*
net_setup.c -- Setup.
Copyright (C) 1998-2005 Ivo Timmermans,
- 2000-201
4
Guus Sliepen <guus@tinc-vpn.org>
+ 2000-201
5
Guus Sliepen <guus@tinc-vpn.org>
2006 Scott Lamb <slamb@slamb.org>
2010 Brandon Black <blblack@gmail.com>
2006 Scott Lamb <slamb@slamb.org>
2010 Brandon Black <blblack@gmail.com>
@@
-226,14
+226,14
@@
static bool read_ecdsa_private_key(void) {
static bool read_invitation_key(void) {
FILE *fp;
static bool read_invitation_key(void) {
FILE *fp;
- char
*fname
;
+ char
fname[PATH_MAX]
;
if(invitation_key) {
ecdsa_free(invitation_key);
invitation_key = NULL;
}
if(invitation_key) {
ecdsa_free(invitation_key);
invitation_key = NULL;
}
-
xasprintf(&
fname, "%s" SLASH "invitations" SLASH "ed25519_key.priv", confbase);
+
snprintf(fname, sizeof
fname, "%s" SLASH "invitations" SLASH "ed25519_key.priv", confbase);
fp = fopen(fname, "r");
fp = fopen(fname, "r");
@@
-244,7
+244,6
@@
static bool read_invitation_key(void) {
logger(DEBUG_ALWAYS, LOG_ERR, "Reading Ed25519 private key file `%s' failed", fname);
}
logger(DEBUG_ALWAYS, LOG_ERR, "Reading Ed25519 private key file `%s' failed", fname);
}
- free(fname);
return invitation_key;
}
return invitation_key;
}
@@
-327,13
+326,12
@@
void regenerate_key(void) {
void load_all_subnets(void) {
DIR *dir;
struct dirent *ent;
void load_all_subnets(void) {
DIR *dir;
struct dirent *ent;
- char
*dname
;
+ char
dname[PATH_MAX]
;
-
xasprintf(&
dname, "%s" SLASH "hosts", confbase);
+
snprintf(dname, sizeof
dname, "%s" SLASH "hosts", confbase);
dir = opendir(dname);
if(!dir) {
logger(DEBUG_ALWAYS, LOG_ERR, "Could not open %s: %s", dname, strerror(errno));
dir = opendir(dname);
if(!dir) {
logger(DEBUG_ALWAYS, LOG_ERR, "Could not open %s: %s", dname, strerror(errno));
- free(dname);
return;
}
return;
}
@@
-380,13
+378,12
@@
void load_all_subnets(void) {
void load_all_nodes(void) {
DIR *dir;
struct dirent *ent;
void load_all_nodes(void) {
DIR *dir;
struct dirent *ent;
- char
*dname
;
+ char
dname[PATH_MAX]
;
-
xasprintf(&
dname, "%s" SLASH "hosts", confbase);
+
snprintf(dname, sizeof
dname, "%s" SLASH "hosts", confbase);
dir = opendir(dname);
if(!dir) {
logger(DEBUG_ALWAYS, LOG_ERR, "Could not open %s: %s", dname, strerror(errno));
dir = opendir(dname);
if(!dir) {
logger(DEBUG_ALWAYS, LOG_ERR, "Could not open %s: %s", dname, strerror(errno));
- free(dname);
return;
}
return;
}