Set FD_CLOEXEC flag on all sockets.
[tinc] / src / route.c
index 3d8d54a..e3bcf3b 100644 (file)
@@ -50,7 +50,10 @@ static const size_t ip6_size = sizeof(struct ip6_hdr);
 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
 
 /* RFC 1071 */
 
@@ -217,7 +220,7 @@ void age_subnets(void) {
        for(node = myself->subnet_tree->head; node; node = next) {
                next = node->next;
                s = node->data;
-               if(s->expires && s->expires < now) {
+               if(s->expires && s->expires <= now) {
                        ifdebug(TRAFFIC) {
                                char netstr[MAXNETSTR];
                                if(net2str(netstr, sizeof netstr, s))