X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet_packet.c;h=7bb182db22822c03b66cefd1b842c13234421a84;hb=1022812ed4b5c70162f2f0a9d9a96c716c936408;hp=290f743f9f8a6509b073c9a5ca5bf15c7d85c21e;hpb=3a149f7521dfff67e6a790c1a830afc649ae083e;p=tinc diff --git a/src/net_packet.c b/src/net_packet.c index 290f743f..7bb182db 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -743,10 +743,10 @@ static void choose_udp_address(const node_t *n, const sockaddr_t **sa, size_t *s So we pick a random edge and a random socket. */ unsigned int i = 0; - unsigned int j = rand() % n->edge_tree->count; + unsigned int j = rand() % n->edge_tree.count; edge_t *candidate = NULL; - for splay_each(edge_t, e, n->edge_tree) { + for splay_each(edge_t, e, &n->edge_tree) { if(i++ == j) { candidate = e->reverse; break; @@ -767,10 +767,10 @@ static void choose_local_address(const node_t *n, const sockaddr_t **sa, size_t /* Pick one of the edges from this node at random, then use its local address. */ unsigned int i = 0; - unsigned int j = rand() % n->edge_tree->count; + unsigned int j = rand() % n->edge_tree.count; edge_t *candidate = NULL; - for splay_each(edge_t, e, n->edge_tree) { + for splay_each(edge_t, e, &n->edge_tree) { if(i++ == j) { candidate = e; break; @@ -1672,7 +1672,7 @@ static node_t *try_harder(const sockaddr_t *from, const vpn_packet_t *pkt) { bool soft = false; - for splay_each(edge_t, e, n->edge_tree) { + for splay_each(edge_t, e, &n->edge_tree) { if(!e->reverse) { continue; }