Add the Forwarding option.

This determines if and how incoming packets that are not meant for the local
node are forwarded.  It can either be off, internal (tinc forwards them itself,
as in previous versions), or kernel (packets are always sent to the TUN/TAP
device, letting the kernel sort them out).
This commit is contained in:
Guus Sliepen 2010-03-02 22:34:26 +01:00
parent 5038964032
commit 95a6974de1
5 changed files with 79 additions and 4 deletions

View file

@ -355,8 +355,21 @@ bool setup_myself(void) {
return false;
}
free(mode);
} else
routing_mode = RMODE_ROUTER;
}
if(get_config_string(lookup_config(config_tree, "Forwarding"), &mode)) {
if(!strcasecmp(mode, "off"))
routing_mode = FMODE_OFF;
else if(!strcasecmp(mode, "internal"))
routing_mode = FMODE_INTERNAL;
else if(!strcasecmp(mode, "kernel"))
routing_mode = FMODE_KERNEL;
else {
logger(LOG_ERR, "Invalid forwarding mode!");
return false;
}
free(mode);
}
choice = true;
get_config_bool(lookup_config(myself->connection->config_tree, "PMTUDiscovery"), &choice);