/*
route.c -- routing
Copyright (C) 2000-2005 Ivo Timmermans,
- 2000-2013 Guus Sliepen <guus@tinc-vpn.org>
+ 2000-2018 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
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif
-volatile int dummy;
static timeout_t age_subnets_timeout;
/* RFC 1071 */
checksum = (checksum & 0xFFFF) + (checksum >> 16);
}
- // Work around a compiler optimization bug.
- if(checksum) {
- dummy = 1;
- }
-
return ~checksum;
}
addr.sin_family = AF_INET;
socklen_t addrlen = sizeof(addr);
- if(!getsockname(sockfd, (struct sockaddr *) &addr, &addrlen) && addrlen <= sizeof(addr)) {
+ if(!getsockname(sockfd, (struct sockaddr *) &addr, &addrlen) && (size_t)addrlen <= sizeof(addr)) {
ip_dst = addr.sin_addr;
}
}
addr.sin6_family = AF_INET6;
socklen_t addrlen = sizeof(addr);
- if(!getsockname(sockfd, (struct sockaddr *) &addr, &addrlen) && addrlen <= sizeof(addr)) {
+ if(!getsockname(sockfd, (struct sockaddr *) &addr, &addrlen) && (size_t)addrlen <= sizeof(addr)) {
pseudo.ip6_src = addr.sin6_addr;
}
}