Apparently sparc64 is way more strict about uint16_t access alignment than I had thought: it gave bus errors when messing with var-cell headers. Maybe this patch will fix bug 862.
svn:r17262
This commit is contained in:
parent
a790a13705
commit
c36ddcbabf
|
@ -8,6 +8,8 @@ Changes in version 0.2.1.8-alpha - 2008-??-??
|
||||||
bug 859.
|
bug 859.
|
||||||
- Made Tor a little less aggressive about deleting expired certificates.
|
- Made Tor a little less aggressive about deleting expired certificates.
|
||||||
Partial fix for bug 854.
|
Partial fix for bug 854.
|
||||||
|
- Stop doing unaligned memory access that generated bus errors on
|
||||||
|
sparc64. Fix for bug 862.
|
||||||
|
|
||||||
o Minor features (controller):
|
o Minor features (controller):
|
||||||
- Return circuit purposes in response to GETINFO circuit-status. Fixes
|
- Return circuit purposes in response to GETINFO circuit-status. Fixes
|
||||||
|
|
|
@ -1010,7 +1010,7 @@ fetch_var_cell_from_buf(buf_t *buf, var_cell_t **out, int linkproto)
|
||||||
return 0;
|
return 0;
|
||||||
peek_from_buf(hdr, sizeof(hdr), buf);
|
peek_from_buf(hdr, sizeof(hdr), buf);
|
||||||
|
|
||||||
command = *(uint8_t*)(hdr+2);
|
command = get_uint8(hdr+2);
|
||||||
if (!(CELL_COMMAND_IS_VAR_LENGTH(command)))
|
if (!(CELL_COMMAND_IS_VAR_LENGTH(command)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -1019,7 +1019,7 @@ fetch_var_cell_from_buf(buf_t *buf, var_cell_t **out, int linkproto)
|
||||||
return 1;
|
return 1;
|
||||||
result = var_cell_new(length);
|
result = var_cell_new(length);
|
||||||
result->command = command;
|
result->command = command;
|
||||||
result->circ_id = ntohs(*(uint16_t*)hdr);
|
result->circ_id = ntohs(get_uint16(hdr));
|
||||||
|
|
||||||
buf_remove_from_front(buf, VAR_CELL_HEADER_SIZE);
|
buf_remove_from_front(buf, VAR_CELL_HEADER_SIZE);
|
||||||
peek_from_buf(result->payload, length, buf);
|
peek_from_buf(result->payload, length, buf);
|
||||||
|
|
|
@ -157,8 +157,8 @@ cell_unpack(cell_t *dest, const char *src)
|
||||||
void
|
void
|
||||||
var_cell_pack_header(const var_cell_t *cell, char *hdr_out)
|
var_cell_pack_header(const var_cell_t *cell, char *hdr_out)
|
||||||
{
|
{
|
||||||
*(uint16_t*)(hdr_out) = htons(cell->circ_id);
|
set_uint16(hdr_out, htons(cell->circ_id));
|
||||||
*(uint8_t*)(hdr_out+2) = cell->command;
|
set_uint8(hdr_out+2, cell->command);
|
||||||
set_uint16(hdr_out+3, htons(cell->payload_len));
|
set_uint16(hdr_out+3, htons(cell->payload_len));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue