X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Froute.c;h=d1048e76dc7c4890ad23c08a4e68048c6d7106a6;hb=refs%2Fheads%2F1.1;hp=79832dcad0f4c899bc3cbc936884707b08445fa0;hpb=3b6d366005b6fc23c705b3156e365316f6ab776c;p=tinc diff --git a/src/route.c b/src/route.c index 79832dca..6f1ffd4c 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; @@ -162,7 +164,7 @@ static void route_ipv4_unreachable(node_t *source, vpn_packet_t *packet, length_ } } - close(sockfd); + closesocket(sockfd); } } @@ -267,7 +269,7 @@ static void route_ipv6_unreachable(node_t *source, vpn_packet_t *packet, length_ } } - close(sockfd); + closesocket(sockfd); } } @@ -515,7 +517,7 @@ static void age_subnets(void *data) { if(left) timeout_set(&age_subnets_timeout, &(struct timeval) { - 10, rand() % 100000 + 10, jitter() }); } @@ -545,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) { @@ -583,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; }