projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- Improved handling of errors on connection attempts.
[tinc]
/
src
/
protocol.c
diff --git
a/src/protocol.c
b/src/protocol.c
index
325177b
..
1fe75e7
100644
(file)
--- a/
src/protocol.c
+++ b/
src/protocol.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: protocol.c,v 1.28.4.
7 2000/06/26 17:20:5
8 guus Exp $
+ $Id: protocol.c,v 1.28.4.
11 2000/06/27 20:10:4
8 guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-62,7
+62,8
@@
cp
return -1;
}
return -1;
}
- syslog(LOG_NOTICE, _("Connection with " IP_ADDR_S " (%s) activated"),
+ if(debug_lvl > 0)
+ syslog(LOG_NOTICE, _("Connection with " IP_ADDR_S " (%s) activated"),
IP_ADDR_V(cl->vpn_ip), cl->hostname);
cp
return 0;
IP_ADDR_V(cl->vpn_ip), cl->hostname);
cp
return 0;
@@
-400,7
+401,7
@@
cp
if(sscanf(cl->buffer, "%*d %d %lx/%lx:%hx %d", &cl->protocol_version, &cl->vpn_ip, &cl->vpn_mask, &cl->port, &cl->flags) != 5)
{
if(sscanf(cl->buffer, "%*d %d %lx/%lx:%hx %d", &cl->protocol_version, &cl->vpn_ip, &cl->vpn_mask, &cl->port, &cl->flags) != 5)
{
- syslog(LOG_ERR, _("Got bad BASIC_INFO from
" IP_ADDR_S
),
+ syslog(LOG_ERR, _("Got bad BASIC_INFO from
%s"
),
cl->hostname);
return -1;
}
cl->hostname);
return -1;
}
@@
-508,6
+509,7
@@
cp
cl->status.active = 1;
syslog(LOG_NOTICE, _("Connection with " IP_ADDR_S " (%s) activated"),
IP_ADDR_V(cl->vpn_ip), cl->hostname);
cl->status.active = 1;
syslog(LOG_NOTICE, _("Connection with " IP_ADDR_S " (%s) activated"),
IP_ADDR_V(cl->vpn_ip), cl->hostname);
+ upstreamindex = 0;
cp
return 0;
}
cp
return 0;
}
@@
-527,11
+529,12
@@
cp
IP_ADDR_V(cl->vpn_ip), cl->hostname);
cl->status.termreq = 1;
IP_ADDR_V(cl->vpn_ip), cl->hostname);
cl->status.termreq = 1;
- cl->status.active = 0;
if(cl->status.active)
notify_others(cl, NULL, send_del_host);
if(cl->status.active)
notify_others(cl, NULL, send_del_host);
+ cl->status.active = 0;
+
terminate_connection(cl);
cp
return 0;
terminate_connection(cl);
cp
return 0;
@@
-587,9
+590,11
@@
cp
return 0;
}
return 0;
}
- notify_others(
cl, fw
, send_del_host);
+ notify_others(
fw, cl
, send_del_host);
fw->status.termreq = 1;
fw->status.termreq = 1;
+ fw->status.active = 0;
+
terminate_connection(fw);
cp
return 0;
terminate_connection(fw);
cp
return 0;
@@
-885,7
+890,7
@@
cp
ik->status.validkey = 0;
ik->status.waitingforkey = 0;
ik->status.validkey = 0;
ik->status.waitingforkey = 0;
- notify_others(
cl, ik
, send_key_changed);
+ notify_others(
ik, cl
, send_key_changed);
cp
return 0;
}
cp
return 0;
}