]> git.meshlink.io Git - meshlink/commitdiff
Fixes for the Forwarding option.
authorGuus Sliepen <guus@tinc-vpn.org>
Tue, 2 Mar 2010 22:27:50 +0000 (23:27 +0100)
committerGuus Sliepen <guus@tinc-vpn.org>
Tue, 2 Mar 2010 22:27:50 +0000 (23:27 +0100)
src/net_setup.c
src/route.c

index 867fef9455592e5e5c0fa26e5f294517bdcdda99..70291bffe97111f5f4a30691e63c56172a669351 100644 (file)
@@ -360,11 +360,11 @@ bool setup_myself(void) {
 
        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;
index 4e7f7e585db410c41f733a582aae7c2540064e43..853b7f5b1acb5a916ec1657131c598e26768b4ec 100644 (file)
@@ -844,7 +844,7 @@ static void route_mac(node_t *source, vpn_packet_t *packet) {
 }
 
 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;
        }