Don't disconnect clients in TunnelServer mode who send unauthorised ADD_SUBNETs.

So that we are liberal in what we accept.
This commit is contained in:
Guus Sliepen 2009-10-11 13:51:10 +02:00
parent 430c90412c
commit 5cddf5e52a

View file

@ -112,7 +112,7 @@ bool add_subnet_h(connection_t *c) {
for(cfg = lookup_config(c->config_tree, "Subnet"); cfg; cfg = lookup_config_next(c->config_tree, cfg)) { for(cfg = lookup_config(c->config_tree, "Subnet"); cfg; cfg = lookup_config_next(c->config_tree, cfg)) {
if(!get_config_subnet(cfg, &allowed)) if(!get_config_subnet(cfg, &allowed))
return false; continue;
if(!subnet_compare(&s, allowed)) if(!subnet_compare(&s, allowed))
break; break;
@ -121,9 +121,9 @@ bool add_subnet_h(connection_t *c) {
} }
if(!cfg) { if(!cfg) {
logger(LOG_WARNING, "Unauthorized %s from %s (%s) for %s", logger(LOG_WARNING, "Ignoring unauthorized %s from %s (%s): %s",
"ADD_SUBNET", c->name, c->hostname, subnetstr); "ADD_SUBNET", c->name, c->hostname, subnetstr);
return false; return true;
} }
free_subnet(allowed); free_subnet(allowed);