X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Froute.c;h=25f2be5e54c5e879c7c25312bbf490672f9755fd;hb=28b7a53b6;hp=69d0ba74a44be90fc376bfb436914c995dbd6998;hpb=04d8a8e34e1fe7f33f1946863b36a24ee358175f;p=tinc diff --git a/src/route.c b/src/route.c index 69d0ba74..25f2be5e 100644 --- a/src/route.c +++ b/src/route.c @@ -22,6 +22,7 @@ #include "connection.h" #include "control_common.h" +#include "crypto.h" #include "ethernet.h" #include "ipv4.h" #include "ipv6.h" @@ -31,6 +32,7 @@ #include "protocol.h" #include "route.h" #include "subnet.h" +#include "utils.h" rmode_t routing_mode = RMODE_ROUTER; fmode_t forwarding_mode = FMODE_INTERNAL; @@ -54,10 +56,6 @@ static const size_t icmp6_size = sizeof(struct icmp6_hdr); static const size_t ns_size = sizeof(struct nd_neighbor_solicit); static const size_t opt_size = sizeof(struct nd_opt_hdr); -#ifndef MAX -#define MAX(a, b) ((a) > (b) ? (a) : (b)) -#endif - static timeout_t age_subnets_timeout; /* RFC 1071 */ @@ -519,7 +517,7 @@ static void age_subnets(void *data) { if(left) timeout_set(&age_subnets_timeout, &(struct timeval) { - 10, rand() % 100000 + 10, jitter() }); } @@ -549,7 +547,7 @@ static void learn_mac(mac_t *address) { } timeout_add(&age_subnets_timeout, age_subnets, NULL, &(struct timeval) { - 10, rand() % 100000 + 10, jitter() }); } else { if(subnet->expires) { @@ -587,7 +585,7 @@ static void fragment_ipv4_packet(node_t *dest, vpn_packet_t *packet, length_t et todo = ntohs(ip.ip_len) - ip_size; if(ether_size + ip_size + todo != packet->len) { - logger(DEBUG_TRAFFIC, LOG_WARNING, "Length of packet (%d) doesn't match length in IPv4 header (%zu)", packet->len, ether_size + ip_size + todo); + logger(DEBUG_TRAFFIC, LOG_WARNING, "Length of packet (%d) doesn't match length in IPv4 header (%lu)", packet->len, (unsigned long)(ether_size + ip_size + todo)); return; }