diff options
Diffstat (limited to 'src/or/circuit.c')
-rw-r--r-- | src/or/circuit.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/or/circuit.c b/src/or/circuit.c index 2cadd6d7d..9c07532ff 100644 --- a/src/or/circuit.c +++ b/src/or/circuit.c @@ -1116,8 +1116,13 @@ int circuit_extend(cell_t *cell, circuit_t *circ) { return -1; } - circ->n_addr = ntohl(*(uint32_t*)(cell->payload+RELAY_HEADER_SIZE)); - circ->n_port = ntohs(*(uint16_t*)(cell->payload+RELAY_HEADER_SIZE+4)); + 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)); n_conn = connection_twin_get_by_addr_port(circ->n_addr,circ->n_port); if(!n_conn || n_conn->type != CONN_TYPE_OR) { |