diff --git a/src/edge_utils.c b/src/edge_utils.c index 9592e51..4afdb64 100644 --- a/src/edge_utils.c +++ b/src/edge_utils.c @@ -683,6 +683,7 @@ static void register_with_new_peer (n2n_edge_t *eee, scan->sock = *peer; scan->timeout = eee->conf.register_interval; /* TODO: should correspond to the peer supernode registration timeout */ scan->last_valid_time_stamp = initial_time_stamp(); + scan->purgeable = true; if(via_multicast) 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->last_seen = now; /* Don't change this it marks the pending peer for removal. */ scan->last_valid_time_stamp = initial_time_stamp(); + scan->purgeable = true; HASH_ADD_PEER(eee->pending_peers, scan); } diff --git a/src/n2n.c b/src/n2n.c index 5d48ebf..c4e31eb 100644 --- a/src/n2n.c +++ b/src/n2n.c @@ -528,6 +528,7 @@ struct peer_info* add_sn_to_list_by_mac_or_sock (struct peer_info **sn_list, n2n if(peer) { sn_selection_criterion_default(&(peer->selection_criterion)); peer->last_valid_time_stamp = initial_time_stamp(); + peer->purgeable = true; memcpy(&(peer->sock), sock, sizeof(n2n_sock_t)); memcpy(peer->mac_addr, mac, sizeof(n2n_mac_t)); HASH_ADD_PEER(*sn_list, peer);