mirror of
https://github.com/ntop/n2n.git
synced 2024-09-19 00:21:11 +02:00
Ensure that we initialise the purgeability of peer structures when we allocate them
This commit is contained in:
parent
e9659e3b9a
commit
1a598fa43b
|
@ -683,6 +683,7 @@ static void register_with_new_peer (n2n_edge_t *eee,
|
||||||
scan->sock = *peer;
|
scan->sock = *peer;
|
||||||
scan->timeout = eee->conf.register_interval; /* TODO: should correspond to the peer supernode registration timeout */
|
scan->timeout = eee->conf.register_interval; /* TODO: should correspond to the peer supernode registration timeout */
|
||||||
scan->last_valid_time_stamp = initial_time_stamp();
|
scan->last_valid_time_stamp = initial_time_stamp();
|
||||||
|
scan->purgeable = true;
|
||||||
if(via_multicast)
|
if(via_multicast)
|
||||||
scan->local = 1;
|
scan->local = 1;
|
||||||
|
|
||||||
|
@ -1903,6 +1904,7 @@ static int check_query_peer_info (n2n_edge_t *eee, time_t now, n2n_mac_t mac) {
|
||||||
scan->timeout = eee->conf.register_interval; /* TODO: should correspond to the peer supernode registration timeout */
|
scan->timeout = eee->conf.register_interval; /* TODO: should correspond to the peer supernode registration timeout */
|
||||||
scan->last_seen = now; /* Don't change this it marks the pending peer for removal. */
|
scan->last_seen = now; /* Don't change this it marks the pending peer for removal. */
|
||||||
scan->last_valid_time_stamp = initial_time_stamp();
|
scan->last_valid_time_stamp = initial_time_stamp();
|
||||||
|
scan->purgeable = true;
|
||||||
|
|
||||||
HASH_ADD_PEER(eee->pending_peers, scan);
|
HASH_ADD_PEER(eee->pending_peers, scan);
|
||||||
}
|
}
|
||||||
|
|
|
@ -528,6 +528,7 @@ struct peer_info* add_sn_to_list_by_mac_or_sock (struct peer_info **sn_list, n2n
|
||||||
if(peer) {
|
if(peer) {
|
||||||
sn_selection_criterion_default(&(peer->selection_criterion));
|
sn_selection_criterion_default(&(peer->selection_criterion));
|
||||||
peer->last_valid_time_stamp = initial_time_stamp();
|
peer->last_valid_time_stamp = initial_time_stamp();
|
||||||
|
peer->purgeable = true;
|
||||||
memcpy(&(peer->sock), sock, sizeof(n2n_sock_t));
|
memcpy(&(peer->sock), sock, sizeof(n2n_sock_t));
|
||||||
memcpy(peer->mac_addr, mac, sizeof(n2n_mac_t));
|
memcpy(peer->mac_addr, mac, sizeof(n2n_mac_t));
|
||||||
HASH_ADD_PEER(*sn_list, peer);
|
HASH_ADD_PEER(*sn_list, peer);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user