diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-04-03 03:07:25 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-04-03 03:07:25 +0000 |
commit | ba196a9d1707361a6f9928f3fd616138e2c58647 (patch) | |
tree | 3f714459c4594f31afa8dc960f15ed3a26174d45 /src/or/circuit.c | |
parent | 8a1ad2b84e180f1851feb467ceb0a636689e724a (diff) | |
download | tor-ba196a9d1707361a6f9928f3fd616138e2c58647.tar tor-ba196a9d1707361a6f9928f3fd616138e2c58647.tar.gz |
Use (set|get)_uint(16|32) in lieu of memcpy where reasonable.
svn:r1462
Diffstat (limited to 'src/or/circuit.c')
-rw-r--r-- | src/or/circuit.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/or/circuit.c b/src/or/circuit.c index c92956182..188d75fd8 100644 --- a/src/or/circuit.c +++ b/src/or/circuit.c @@ -1315,13 +1315,8 @@ int circuit_extend(cell_t *cell, circuit_t *circ) { return -1; } - memcpy(&circ->n_addr, cell->payload+RELAY_HEADER_SIZE, 4); - circ->n_addr = ntohl(circ->n_addr); - memcpy(&circ->n_port, cell->payload+RELAY_HEADER_SIZE+4, 2); - circ->n_port = ntohs(circ->n_port); - -// circ->n_addr = ntohl(*(uint32_t*)(cell->payload+RELAY_HEADER_SIZE)); -// circ->n_port = ntohs(*(uint16_t*)(cell->payload+RELAY_HEADER_SIZE+4)); + circ->n_addr = ntohl(get_uint32(cell->payload+RELAY_HEADER_SIZE)); + circ->n_port = ntohs(get_uint16(cell->payload+RELAY_HEADER_SIZE+4)); n_conn = connection_twin_get_by_addr_port(circ->n_addr,circ->n_port); if(!n_conn || n_conn->type != CONN_TYPE_OR) { |