Mysterious "XXXX RD This is a bug, right?" comment from Nick
In circuit_package_relay_cell() we have this interesting stanza:
thishop = layer_hint;
/* moving from farthest to nearest hop */
do {
tor_assert(thishop);
/* XXXX RD This is a bug, right? */
log_debug(LD_OR,"crypting a layer of the relay cell.");
if (relay_crypt_one_payload(thishop->f_crypto, cell->payload, 1) < 0) {
return -1;
}
thishop = thishop->prev;
} while (thishop != TO_ORIGIN_CIRCUIT(circ)->cpath->prev);
Despite the "RD", I think this is a comment written by Nick, intended for me.
It arrived during commit 452f4cfa in Oct 2005, and actually there were two of those comments, though one of them got resolved by commit a312afd6 in May 2007.
That leaves one, and it's a mystery to me. What is the bug?
Maybe it's that relay_crypt_one_payload() can now only return 0, so checking its return value is dumb? That refactoring seems worth doing. (See also commit edd93f9d from Feb 2016.)
Nick, do you have any guesses what you meant here?