X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fprotocol.c;h=70122c1be7bfeb9e6d62bca7f76e942487be713f;hb=45a28b1e893d4da9d7977945a35ec6a8e4554830;hp=b918d5b133b7f67074db1c11b9bd11df6d129809;hpb=783c8298610d5670f6e118f49bd3d1fdfa61ae1d;p=tinc diff --git a/src/protocol.c b/src/protocol.c index b918d5b1..70122c1b 100644 --- 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. - $Id: protocol.c,v 1.28.4.8 2000/06/26 19:39:34 guus Exp $ + $Id: protocol.c,v 1.28.4.10 2000/06/27 12:58:04 guus Exp $ */ #include "config.h" @@ -62,7 +62,8 @@ cp 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; @@ -402,6 +403,16 @@ cp { syslog(LOG_ERR, _("Got bad BASIC_INFO from %s"), cl->hostname); + if(cl->status.outgoing) + { + /* If we get here, it means that our uplink uses the wrong protocol. + If we don't do anything, we will reconnect every 5 seconds. Pretty dumb. + So we disable the outgoing flag, so that we won't reconnect anymore. + This still allows other tinc daemons to connect to us. + */ + syslog(LOG_ERR, _("Warning: disabling uplink!")); + cl->status.outgoing = 0; + } return -1; } @@ -527,11 +538,12 @@ cp 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); + cl->status.active = 0; + terminate_connection(cl); cp return 0; @@ -587,9 +599,11 @@ cp return 0; } - notify_others(cl, fw, send_del_host); + notify_others(fw, cl, send_del_host); fw->status.termreq = 1; + fw->status.active = 0; + terminate_connection(fw); cp return 0; @@ -885,7 +899,7 @@ cp 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; }