--- src/or/buffers.c- 2008-11-13 22:41:16.000000000 +0000 +++ src/or/buffers.c 2008-11-13 22:46:46.000000000 +0000 @@ -957,7 +957,8 @@ return 0; peek_from_buf(hdr, sizeof(hdr), buf); - command = *(uint8_t*)(hdr+2); + /* command = *(uint8_t*)(hdr+2); */ + command = get_uint8(hdr+2); if (!(CELL_COMMAND_IS_VAR_LENGTH(command))) return 0; @@ -966,7 +967,8 @@ return 1; result = var_cell_new(length); result->command = command; - result->circ_id = ntohs(*(uint16_t*)hdr); + /* result->circ_id = ntohs(*(uint16_t*)hdr); */ + result->circ_id = ntohs(get_uint16(hdr)); buf_remove_from_front(buf, VAR_CELL_HEADER_SIZE); peek_from_buf(result->payload, length, buf); --- src/or/connection_or.c- 2008-06-13 05:12:28.000000000 +0000 +++ src/or/connection_or.c 2008-11-13 22:48:56.000000000 +0000 @@ -157,8 +157,12 @@ void var_cell_pack_header(const var_cell_t *cell, char *hdr_out) { + /* *(uint16_t*)(hdr_out) = htons(cell->circ_id); *(uint8_t*)(hdr_out+2) = cell->command; + */ + set_uint16(hdr_out, htons(cell->circ_id)); + set_uint8(hdr_out+2, cell->command); set_uint16(hdr_out+3, htons(cell->payload_len)); }