]> git.meshlink.io Git - meshlink/blobdiff - src/route.c
Remove forwarding_mode, broadcast_mode, directonly, priorityinheritance, macexpire...
[meshlink] / src / route.c
index 317d120f568f9209d8ca28c7ae82c237af110e62..8a952a7817404ab402baedb04ff64cd3779c8ecf 100644 (file)
 #include "utils.h"
 #include "libmeshlink.h"
 
-rmode_t routing_mode = RMODE_ROUTER;
-fmode_t forwarding_mode = FMODE_INTERNAL;
-bmode_t broadcast_mode = BMODE_MST;
 bool decrement_ttl = false;
-bool directonly = false;
-bool priorityinheritance = false;
-int macexpire = 600;
-mac_t mymac = {{0xFE, 0xFD, 0, 0, 0, 0}};
-bool pcap = false;
 
 static bool ratelimit(int frequency) {
        static time_t lasttime = 0;
@@ -66,6 +58,7 @@ void route(node_t *source,vpn_packet_t *packet) {
     node_t* via = NULL;
     tincpackethdr* hdr = (tincpackethdr*)packet->data;
     owner = lookup_node(hdr->destination);
+    logger(DEBUG_TRAFFIC, LOG_WARNING, "Routing packet from: %s . To: %s \n",hdr->source,hdr->destination);
 
     //Check Lenght
     if(!checklength(source, packet, (sizeof(tincpackethdr))))
@@ -74,6 +67,7 @@ void route(node_t *source,vpn_packet_t *packet) {
     if (owner == NULL) {
     //Lookup failed
     logger(DEBUG_TRAFFIC, LOG_WARNING, "Cant lookup the owner of a packet in the route() function. This should never happen \n");
+    logger(DEBUG_TRAFFIC, LOG_WARNING, "Destination was: %s \n",hdr->destination);
     return;
     }
 
@@ -96,11 +90,6 @@ void route(node_t *source,vpn_packet_t *packet) {
        return;
     }
 
-    if (directonly && owner!=via) {
-    logger(DEBUG_TRAFFIC, LOG_WARNING, "Direct Only is requested. Dropping packet because direct connection not available \n");
-    return;
-    }
-
     send_packet(owner,packet);
     return;
 }