+ /* Initiator is at offset 0. */
+ for (off=1;off<path_length;off++)
+ if (0 == memcmp (&my_full_id,
+ &pids[off],
+ sizeof (struct GNUNET_PeerIdentity)))
+ break;
+ if (off == path_length)
+ {
+ /* We are not on the path, bogus request */
+ GNUNET_break_op (0);
+ return;
+ }
+ /* Check previous hop */
+ if (sender != GCP_get (&pids[off - 1],
+ GNUNET_NO))
+ {
+ /* sender is not on the path, not allowed */
+ GNUNET_break_op (0);
+ return;
+ }
+ if (off == path_length - 1)
+ {
+ /* We are the destination, create connection */
+ return;
+ }
+ /* We are merely a hop on the way, check if we can support the route */
+ next = GCP_get (&pids[off + 1],
+ GNUNET_NO);
+ if (NULL == next)
+ {
+ /* unworkable, send back BROKEN */
+ GNUNET_break (0); // FIXME...
+ return;
+ }
+
+ route = GNUNET_new (struct CadetRoute);
+