diff options
author | Bart Polot <bart@net.in.tum.de> | 2014-12-15 07:18:22 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2014-12-15 07:18:22 +0000 |
commit | 821bf0aafe27fe327b9a07dcca8b12b5779f7486 (patch) | |
tree | fbca3273a5e89e58e58f7cd958ce3418ad22ebd8 /src/cadet | |
parent | ad686bc0cc41000501b964dd27159bb70a9146bd (diff) | |
download | gnunet-821bf0aafe27fe327b9a07dcca8b12b5779f7486.tar.gz gnunet-821bf0aafe27fe327b9a07dcca8b12b5779f7486.zip |
- destroy old connection in case of duplicate connections when ownID > peerID
Diffstat (limited to 'src/cadet')
-rw-r--r-- | src/cadet/gnunet-service-cadet_connection.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c index 24f63054a..50768d413 100644 --- a/src/cadet/gnunet-service-cadet_connection.c +++ b/src/cadet/gnunet-service-cadet_connection.c | |||
@@ -1599,7 +1599,19 @@ does_connection_exist (struct CadetConnection *conn) | |||
1599 | } | 1599 | } |
1600 | 1600 | ||
1601 | if (GNUNET_CRYPTO_cmp_peer_identity (&my_full_id, GCP_get_id (p)) > 0) | 1601 | if (GNUNET_CRYPTO_cmp_peer_identity (&my_full_id, GCP_get_id (p)) > 0) |
1602 | { | ||
1603 | struct CadetPeer *neighbor; | ||
1604 | |||
1605 | LOG (GNUNET_ERROR_TYPE_DEBUG, " duplicate allowed (killing old)\n"); | ||
1606 | if (GCC_is_origin (c, GNUNET_YES)) | ||
1607 | neighbor = get_next_hop (c); | ||
1608 | else | ||
1609 | neighbor = get_prev_hop (c); | ||
1610 | send_broken_unknown (&c->id, &my_full_id, NULL, | ||
1611 | GCP_get_id (neighbor)); | ||
1612 | GCC_destroy (c); | ||
1602 | return GNUNET_NO; | 1613 | return GNUNET_NO; |
1614 | } | ||
1603 | else | 1615 | else |
1604 | return GNUNET_YES; | 1616 | return GNUNET_YES; |
1605 | } | 1617 | } |