/*
graph.c -- graph algorithms
- Copyright (C) 2001-2004 Guus Sliepen <guus@tinc-vpn.org>,
- 2001-2004 Ivo Timmermans <ivo@tinc-vpn.org>
+ Copyright (C) 2001-2005 Guus Sliepen <guus@tinc-vpn.org>,
+ 2001-2005 Ivo Timmermans <ivo@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
free(e->to->hostname);
e->to->hostname = sockaddr2hostname(&e->to->address);
- avl_insert_node(node_udp_tree, node);
+
+ if(node)
+ avl_insert_node(node_udp_tree, node);
if(e->to->options & OPTION_PMTU_DISCOVERY) {
e->to->mtuprobes = 0;
if(n->status.reachable) {
ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Node %s (%s) became reachable"),
n->name, n->hostname);
+ avl_insert(node_udp_tree, n);
} else {
ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Node %s (%s) became unreachable"),
n->name, n->hostname);
+ avl_delete(node_udp_tree, n);
}
n->status.validkey = false;