]> git.meshlink.io Git - meshlink/blobdiff - src/route.c
Push data from the application to the library and print to screen this data in route...
[meshlink] / src / route.c
index 1d0c6f8a40efc15560bdade6fec92450ddbb35b4..83b9029327aa2bb3918d2e60a2d0a643a81cb16c 100644 (file)
@@ -1,7 +1,7 @@
 /*
     route.c -- routing
     Copyright (C) 2000-2005 Ivo Timmermans,
-                  2000-2012 Guus Sliepen <guus@tinc-vpn.org>
+                  2000-2013 Guus Sliepen <guus@tinc-vpn.org>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -229,7 +229,7 @@ static void learn_mac(mac_t *address) {
 
                subnet = new_subnet();
                subnet->type = SUBNET_MAC;
-               subnet->expires = time(NULL) + macexpire;
+               subnet->expires = now.tv_sec + macexpire;
                subnet->net.mac.address = *address;
                subnet->weight = 10;
                subnet_add(myself, subnet);
@@ -244,7 +244,7 @@ static void learn_mac(mac_t *address) {
                timeout_add(&age_subnets_timeout, age_subnets, NULL, &(struct timeval){10, rand() % 100000});
        } else {
                if(subnet->expires)
-                       subnet->expires = time(NULL) + macexpire;
+                       subnet->expires = now.tv_sec + macexpire;
        }
 }
 
@@ -946,6 +946,12 @@ static bool do_decrement_ttl(node_t *source, vpn_packet_t *packet) {
 }
 
 void route(node_t *source, vpn_packet_t *packet) {
+
+       if (/*libmeshlink*/ 1) {
+       printf("%s\n",packet->data);
+       return;
+       }
+
        if(pcap)
                send_pcap(packet);