From: Nick Mathewson Date: Fri, 18 Apr 2025 01:19:34 +0000 (-0400) Subject: Remove the unused relay_msg_set function X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e699121b9f6cda01dc2941d40e0dd3c06fc942f7;p=thirdparty%2Ftor.git Remove the unused relay_msg_set function --- diff --git a/src/core/or/relay_msg.c b/src/core/or/relay_msg.c index 458331f634..0684fd3166 100644 --- a/src/core/or/relay_msg.c +++ b/src/core/or/relay_msg.c @@ -75,25 +75,6 @@ relay_msg_copy(const relay_msg_t *msg) return new_msg; } -/** Set a relay message data into the given message. Useful for stack allocated - * messages. - * - * Note that the resulting relay_msg will have a reference to - * 'payload', which must not be changed while this message is in use. - **/ -void -relay_msg_set(const uint8_t relay_cell_proto, const uint8_t cmd, - const streamid_t stream_id, const uint8_t *payload, - const uint16_t payload_len, relay_msg_t *msg) -{ - (void) relay_cell_proto; - msg->command = cmd; - msg->stream_id = stream_id; - - msg->length = payload_len; - msg->body = payload; -} - /* Add random bytes to the unused portion of the payload, to foil attacks * where the other side can predict all of the bytes in the payload and thus * compute the authenticated SENDME cells without seeing the traffic. See diff --git a/src/core/or/relay_msg.h b/src/core/or/relay_msg.h index ab99e11d69..413f876310 100644 --- a/src/core/or/relay_msg.h +++ b/src/core/or/relay_msg.h @@ -17,9 +17,6 @@ void relay_msg_free_(relay_msg_t *msg); void relay_msg_clear(relay_msg_t *msg); relay_msg_t *relay_msg_copy(const relay_msg_t *msg); -void relay_msg_set(const uint8_t relay_cell_proto, const uint8_t cmd, - const streamid_t streamd_id, const uint8_t *payload, - const uint16_t payload_len, relay_msg_t *msg); int relay_msg_encode_cell(relay_cell_fmt_t format, const relay_msg_t *msg,