if(get_config_string(lookup_config(config_tree, "Forwarding"), &mode)) {
if(!strcasecmp(mode, "off"))
- routing_mode = FMODE_OFF;
+ forwarding_mode = FMODE_OFF;
else if(!strcasecmp(mode, "internal"))
- routing_mode = FMODE_INTERNAL;
+ forwarding_mode = FMODE_INTERNAL;
else if(!strcasecmp(mode, "kernel"))
- routing_mode = FMODE_KERNEL;
+ forwarding_mode = FMODE_KERNEL;
else {
logger(LOG_ERR, "Invalid forwarding mode!");
return false;
}
void route(node_t *source, vpn_packet_t *packet) {
- if(forwarding_mode == FMODE_KERNEL) {
+ if(forwarding_mode == FMODE_KERNEL && source != myself) {
send_packet(myself, packet);
return;
}