Merge branch 'master' into 1.1

Conflicts:
	NEWS
	README
	configure.in
	doc/tinc.texi
	doc/tincd.8.in
	src/Makefile.am
	src/connection.c
	src/edge.c
	src/meta.c
	src/net.c
	src/net.h
	src/net_packet.c
	src/net_setup.c
	src/net_socket.c
	src/node.c
	src/openssl/rsagen.h
	src/protocol_auth.c
	src/protocol_edge.c
	src/subnet.c
This commit is contained in:
Guus Sliepen 2009-11-02 14:24:27 +01:00
commit 108b238915
26 changed files with 288 additions and 124 deletions

View file

@ -45,7 +45,7 @@ bool add_subnet_h(connection_t *c, char *request) {
char subnetstr[MAX_STRING_SIZE];
char name[MAX_STRING_SIZE];
node_t *owner;
subnet_t s = {0}, *new;
subnet_t s = {0}, *new, *old;
if(sscanf(request, "%*d %*x " MAX_STRING " " MAX_STRING, name, subnetstr) != 2) {
logger(LOG_ERR, "Got bad %s from %s (%s)", "ADD_SUBNET", c->name,
@ -112,7 +112,7 @@ bool add_subnet_h(connection_t *c, char *request) {
for(cfg = lookup_config(c->config_tree, "Subnet"); cfg; cfg = lookup_config_next(c->config_tree, cfg)) {
if(!get_config_subnet(cfg, &allowed))
return false;
continue;
if(!subnet_compare(&s, allowed))
break;
@ -121,9 +121,9 @@ bool add_subnet_h(connection_t *c, char *request) {
}
if(!cfg) {
logger(LOG_WARNING, "Unauthorized %s from %s (%s) for %s",
"ADD_SUBNET", c->name, c->hostname, subnetstr);
return false;
logger(LOG_WARNING, "Ignoring unauthorized %s from %s (%s): %s",
"ADD_SUBNET", c->name, c->hostname, subnetstr);
return true;
}
free_subnet(allowed);
@ -142,6 +142,11 @@ bool add_subnet_h(connection_t *c, char *request) {
if(!tunnelserver)
forward_request(c, request);
/* Fast handoff of roaming MAC addresses */
if(s.type == SUBNET_MAC && owner != myself && (old = lookup_subnet(myself, &s)) && old->expires)
old->expires = 1;
return true;
}