- if(sscanf(cl->buffer, "%*d %d %lx/%lx:%hx", &cl->protocol_version, &cl->vpn_ip, &cl->vpn_mask, &cl->port) != 4)
- {
- syslog(LOG_ERR, "got bad BASIC_INFO request: %s", cl->buffer);
+ if(debug_lvl > 1)
+ syslog(LOG_DEBUG, _("Got BASIC_INFO from %s"), cl->hostname);
+
+ 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 %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;
+ }