From be7afe658e5fc6745a369d6fb3fbc4bb6037da18 Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Wed, 12 Oct 2022 20:29:11 +0200 Subject: Clip DNS TTL values once in event callback This change ensures that other parts of the code base always operate on the same clipped TTL values, notably without being aware of clipping. --- src/core/or/connection_edge.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/or/connection_edge.c b/src/core/or/connection_edge.c index d9067d5c29..b96f4eb211 100644 --- a/src/core/or/connection_edge.c +++ b/src/core/or/connection_edge.c @@ -546,7 +546,7 @@ connection_edge_end(edge_connection_t *conn, uint8_t reason) memcpy(payload+1, tor_addr_to_in6_addr8(&conn->base_.addr), 16); addrlen = 16; } - set_uint32(payload+1+addrlen, htonl(clip_dns_ttl(conn->address_ttl))); + set_uint32(payload+1+addrlen, htonl(conn->address_ttl)); payload_len += 4+addrlen; } @@ -911,7 +911,7 @@ connected_cell_format_payload(uint8_t *payload_out, return -1; } - set_uint32(payload_out + connected_payload_len, htonl(clip_dns_ttl(ttl))); + set_uint32(payload_out + connected_payload_len, htonl(ttl)); connected_payload_len += 4; tor_assert(connected_payload_len <= MAX_CONNECTED_CELL_PAYLOAD_LEN); -- cgit v1.2.3-54-g00ecf