diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-04-04 09:43:10 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-04-04 09:43:10 +0000 |
commit | c303b97bd731aef372ec24ebe8b47ee014ada23b (patch) | |
tree | aa287d7443434a9147cfb08fe0caa12e9c8de9e4 /src/transport/gnunet-service-transport_validation.c | |
parent | ed18131bd038617c03e0b3b83e3eb56c31dc3e4a (diff) | |
download | gnunet-c303b97bd731aef372ec24ebe8b47ee014ada23b.tar.gz gnunet-c303b97bd731aef372ec24ebe8b47ee014ada23b.zip |
changes for mantis 0002676
Diffstat (limited to 'src/transport/gnunet-service-transport_validation.c')
-rw-r--r-- | src/transport/gnunet-service-transport_validation.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c index dbe5adf4f..a6c0b7f9d 100644 --- a/src/transport/gnunet-service-transport_validation.c +++ b/src/transport/gnunet-service-transport_validation.c | |||
@@ -1283,11 +1283,11 @@ GST_validation_handle_hello (const struct GNUNET_MessageHeader *hello) | |||
1283 | (const struct GNUNET_HELLO_Message *) hello; | 1283 | (const struct GNUNET_HELLO_Message *) hello; |
1284 | struct ValidateAddressContext vac; | 1284 | struct ValidateAddressContext vac; |
1285 | struct GNUNET_HELLO_Message *h; | 1285 | struct GNUNET_HELLO_Message *h; |
1286 | int type; | ||
1287 | int friend; | 1286 | int friend; |
1288 | 1287 | ||
1289 | 1288 | friend = GNUNET_HELLO_is_friend_only (hm); | |
1290 | if ((GNUNET_OK != GNUNET_HELLO_get_id (hm, &vac.pid)) || | 1289 | if (((GNUNET_YES != friend) && (GNUNET_NO != friend)) || |
1290 | (GNUNET_OK != GNUNET_HELLO_get_id (hm, &vac.pid)) || | ||
1291 | (GNUNET_OK != GNUNET_HELLO_get_key (hm, &vac.public_key))) | 1291 | (GNUNET_OK != GNUNET_HELLO_get_key (hm, &vac.public_key))) |
1292 | { | 1292 | { |
1293 | /* malformed HELLO */ | 1293 | /* malformed HELLO */ |
@@ -1298,19 +1298,6 @@ GST_validation_handle_hello (const struct GNUNET_MessageHeader *hello) | |||
1298 | memcmp (&GST_my_identity, &vac.pid, sizeof (struct GNUNET_PeerIdentity))) | 1298 | memcmp (&GST_my_identity, &vac.pid, sizeof (struct GNUNET_PeerIdentity))) |
1299 | return; | 1299 | return; |
1300 | /* Add peer identity without addresses to peerinfo service */ | 1300 | /* Add peer identity without addresses to peerinfo service */ |
1301 | type = ntohs(hello->type); | ||
1302 | switch (type) { | ||
1303 | case GNUNET_MESSAGE_TYPE_HELLO: | ||
1304 | friend = GNUNET_NO; | ||
1305 | break; | ||
1306 | case GNUNET_MESSAGE_TYPE_FRIEND_HELLO: | ||
1307 | friend = GNUNET_YES; | ||
1308 | break; | ||
1309 | default: | ||
1310 | GNUNET_break (0); | ||
1311 | friend = GNUNET_NO; | ||
1312 | break; | ||
1313 | } | ||
1314 | h = GNUNET_HELLO_create (&vac.public_key, NULL, NULL, friend); | 1301 | h = GNUNET_HELLO_create (&vac.public_key, NULL, NULL, friend); |
1315 | GNUNET_PEERINFO_add_peer (GST_peerinfo, h, NULL, NULL); | 1302 | GNUNET_PEERINFO_add_peer (GST_peerinfo, h, NULL, NULL); |
1316 | 1303 | ||