On 1/17/19 10:50 AM, Samuel Thibault wrote: > Hello, > > Richard Henderson, le mer. 26 déc. 2018 14:42:54 +1100, a ecrit: >> The pointer may be unaligned, so we must use our routines for that. >> At the same time, we might as well use the big-endian version >> instead of ntohs. >> >> This fixes sparc64 host SIGBUS during pxe boot. > > I'm not at ease with applying this, when Marc-André is trying to make > slirp an external library... I'd rather apply the change below, could > somebody review it?
Fair. > - proto = ntohs(*(uint16_t *)(pkt + 12)); > + proto = (((uint16_t) pkt[12]) << 8) + pkt[13]; This works for me too, though I note unnecessary parenthesis around the cast. Reviewed-by: Richard Henderson <richard.hender...@linaro.org> r~
