/*
connection.c -- connection list management
- Copyright (C) 2000-2006 Guus Sliepen <guus@tinc-vpn.org>,
+ Copyright (C) 2000-2007 Guus Sliepen <guus@tinc-vpn.org>,
2000-2005 Ivo Timmermans
This program is free software; you can redistribute it and/or modify
{
cp();
+ if(c->name)
+ free(c->name);
+
if(c->hostname)
free(c->hostname);
/*
net_socket.c -- Handle various kinds of sockets.
Copyright (C) 1998-2005 Ivo Timmermans,
- 2000-2006 Guus Sliepen <guus@tinc-vpn.org>
+ 2000-2007 Guus Sliepen <guus@tinc-vpn.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
sockaddrunmap(&sa);
c = new_connection();
- c->name = NULL;
+ c->name = xstrdup("<unknown>");
c->outcipher = myself->connection->outcipher;
c->outdigest = myself->connection->outdigest;
c->outmaclength = myself->connection->outmaclength;
/*
protocol_auth.c -- handle the meta-protocol, authentication
Copyright (C) 1999-2005 Ivo Timmermans,
- 2000-2006 Guus Sliepen <guus@tinc-vpn.org>
+ 2000-2007 Guus Sliepen <guus@tinc-vpn.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
return false;
}
- /* If we set c->name in advance, make sure we are connected to the right host */
+ /* If this is an outgoing connection, make sure we are connected to the right host */
- if(c->name) {
+ if(c->outgoing) {
if(strcmp(c->name, name)) {
logger(LOG_ERR, _("Peer %s is %s instead of %s"), c->hostname, name,
c->name);