aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_cell_formats.c
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus@mullvad.net>2022-10-12 20:29:11 +0200
committerDavid Goulet <dgoulet@torproject.org>2022-11-28 10:25:04 -0500
commitbe7afe658e5fc6745a369d6fb3fbc4bb6037da18 (patch)
tree06d023f94d4686d27a91b04f28ccbeb9061f761c /src/test/test_cell_formats.c
parentee38514cc4372bfb7d01ee96a1110d600a30e061 (diff)
downloadtor-be7afe658e5fc6745a369d6fb3fbc4bb6037da18.tar.gz
tor-be7afe658e5fc6745a369d6fb3fbc4bb6037da18.zip
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.
Diffstat (limited to 'src/test/test_cell_formats.c')
-rw-r--r--src/test/test_cell_formats.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/test_cell_formats.c b/src/test/test_cell_formats.c
index f9ff101c98..cae25d00ec 100644
--- a/src/test/test_cell_formats.c
+++ b/src/test/test_cell_formats.c
@@ -354,7 +354,7 @@ test_cfmt_connected_cells(void *arg)
rh.length = connected_cell_format_payload(cell.payload+RELAY_HEADER_SIZE,
&addr, 1024);
tt_int_op(rh.length, OP_EQ, 8);
- test_memeq_hex(cell.payload+RELAY_HEADER_SIZE, "1e28323c" "00000e10");
+ test_memeq_hex(cell.payload+RELAY_HEADER_SIZE, "1e28323c" "00000400");
/* Try parsing it. */
tor_addr_make_unspec(&addr);
@@ -362,7 +362,7 @@ test_cfmt_connected_cells(void *arg)
tt_int_op(r, OP_EQ, 0);
tt_int_op(tor_addr_family(&addr), OP_EQ, AF_INET);
tt_str_op(fmt_addr(&addr), OP_EQ, "30.40.50.60");
- tt_int_op(ttl, OP_EQ, 3600); /* not 1024, since we clipped to 3600 */
+ tt_int_op(ttl, OP_EQ, 1024);
/* Try an IPv6 address */
memset(&rh, 0, sizeof(rh));