[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] slirp: Use lduw_be_p in slirp_input
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH] slirp: Use lduw_be_p in slirp_input |
Date: |
Thu, 17 Jan 2019 11:05:20 +1100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 |
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 <address@hidden>
r~