- reconnect (ic->h);
- if (ic->timeout_task != GNUNET_SCHEDULER_NO_TASK)
- GNUNET_SCHEDULER_cancel (ic->timeout_task);
- if (ic->callback != NULL)
- ic->callback (ic->callback_cls, NULL, NULL,
- _("Received invalid message from `PEERINFO' service.\n"));
- GNUNET_free (ic);
+ GNUNET_PEERINFO_iterate_cancel (ic);
+ reconnect (h);
+ if (NULL != cb)
+ cb (cb_cls, NULL, NULL,
+ _("Received invalid message from `PEERINFO' service."));
+ return;
+ }
+ if (GNUNET_OK != GNUNET_HELLO_get_id (hello, &id))
+ {
+ /* malformed message */
+ GNUNET_break (0);
+ GNUNET_PEERINFO_iterate_cancel (ic);
+ reconnect (h);
+ if (NULL != cb)
+ cb (cb_cls, NULL, NULL,
+ _("Received invalid message from `PEERINFO' service."));
+ return;
+ }
+ if (0 != memcmp (&im->peer, &id, sizeof (struct GNUNET_PeerIdentity)))
+ {
+ /* malformed message */
+ GNUNET_break (0);
+ GNUNET_PEERINFO_iterate_cancel (ic);
+ reconnect (h);
+ if (NULL != cb)
+ cb (cb_cls, NULL, NULL,
+ _("Received invalid message from `PEERINFO' service."));