projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- Seed the PRNG using /dev/random before generating the keys.
[tinc]
/
src
/
connlist.c
diff --git
a/src/connlist.c
b/src/connlist.c
index
f1b0eba
..
38c7c8b
100644
(file)
--- a/
src/connlist.c
+++ b/
src/connlist.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: connlist.c,v 1.1.2.
3 2000/10/14 17:04:13
guus Exp $
+ $Id: connlist.c,v 1.1.2.
6 2000/10/16 19:04:46
guus Exp $
*/
#include <syslog.h>
*/
#include <syslog.h>
@@
-53,7
+53,7
@@
cp
destroy_queue(p->sq);
if(p->rq)
destroy_queue(p->rq);
destroy_queue(p->sq);
if(p->rq)
destroy_queue(p->rq);
- if(p->name)
+ if(p->name
&& p->name!=unknown
)
free(p->name);
if(p->hostname)
free(p->hostname);
free(p->name);
if(p->hostname)
free(p->hostname);
@@
-61,6
+61,8
@@
cp
RSA_free(p->public_key);
if(p->cipher_pktkey)
free(p->cipher_pktkey);
RSA_free(p->public_key);
if(p->cipher_pktkey)
free(p->cipher_pktkey);
+ if(p->buffer)
+ free(p->buffer);
free(p);
cp
}
free(p);
cp
}
@@
-118,7
+120,8
@@
void conn_list_add(conn_list_t *cl)
cp
cl->next = conn_list;
cl->prev = NULL;
cp
cl->next = conn_list;
cl->prev = NULL;
- cl->next->prev = cl;
+ if(cl->next)
+ cl->next->prev = cl;
conn_list = cl;
cp
}
conn_list = cl;
cp
}
@@
-143,8
+146,9
@@
conn_list_t *lookup_id(char *name)
conn_list_t *p;
cp
for(p = conn_list; p != NULL; p = p->next)
conn_list_t *p;
cp
for(p = conn_list; p != NULL; p = p->next)
- if(strcmp(name, p->name) == 0)
- break;
+ if(p->status.active)
+ if(strcmp(name, p->name) == 0)
+ break;
cp
return p;
}
cp
return p;
}
@@
-214,7
+218,7
@@
int read_host_config(conn_list_t *cl)
char *fname;
int x;
cp
char *fname;
int x;
cp
- asprintf(fname, "%s/hosts/%s", confbase, cl->name);
+ asprintf(
&
fname, "%s/hosts/%s", confbase, cl->name);
x = read_config_file(&cl->config, fname);
free(fname);
cp
x = read_config_file(&cl->config, fname);
free(fname);
cp