#include "protocol.h"
#include "route.h"
#include "utils.h"
+#include "random.h"
/* The minimum size of a probe is 14 bytes, but since we normally use CBC mode
encryption, we can add a few extra random bytes without increasing the
if(connect(sock, &sa->sa, SALEN(sa->sa))) {
logger(DEBUG_TRAFFIC, LOG_ERR, "Connecting MTU assessment socket for %s (%s) failed: %s", n->name, n->hostname, sockstrerror(sockerrno));
- close(sock);
+ closesocket(sock);
return MTU;
}
if(getsockopt(sock, IPPROTO_IP, IP_MTU, (void *)&ip_mtu, &ip_mtu_len)) {
logger(DEBUG_TRAFFIC, LOG_ERR, "getsockopt(IP_MTU) on %s (%s) failed: %s", n->name, n->hostname, sockstrerror(sockerrno));
- close(sock);
+ closesocket(sock);
return MTU;
}
- close(sock);
+ closesocket(sock);
if(ip_mtu < MINMTU) {
logger(DEBUG_TRAFFIC, LOG_ERR, "getsockopt(IP_MTU) on %s (%s) returned absurdly small value: %d", n->name, n->hostname, ip_mtu);
break;
+ case BMODE_NONE:
default:
break;
}