]> git.ipfire.org Git - thirdparty/qemu.git/commit
net: fix misaligned member access
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 9 Feb 2018 19:03:40 +0000 (20:03 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 2 Mar 2018 18:44:00 +0000 (18:44 +0000)
commit4f51e1d386e306a6a94ee997651f580e1c9f7b54
treea5bbdb341cd0203cac4d47cf9f1b6a26426e29dc
parent136c67e07869227b21b3f627316e03679ce7b738
net: fix misaligned member access

Fixes the following ASAN warnings:

/home/elmarco/src/qemu/hw/net/net_tx_pkt.c:201:27: runtime error: member access within misaligned address 0x631000028846 for type 'struct ip_header', which requires 4 byte alignment
0x631000028846: note: pointer points here
 01 00 00 00 45 00  01 a9 01 00 00 00 40 11  78 45 00 00 00 00 ff ff  ff ff 00 00 00 00 00 00  00 00
             ^
/home/elmarco/src/qemu/hw/net/net_tx_pkt.c:208:63: runtime error: member access within misaligned address 0x631000028846 for type 'struct ip_header', which requires 4 byte alignment
0x631000028846: note: pointer points here
 01 00 00 00 45 00  01 a9 01 00 00 00 40 11  78 45 00 00 00 00 ff ff  ff ff 00 00 00 00 00 00  00 00
             ^
/home/elmarco/src/qemu/hw/net/net_tx_pkt.c:210:13: runtime error: member access within misaligned address 0x631000028846 for type 'struct ip_header', which requires 4 byte alignment
0x631000028846: note: pointer points here
 01 00 00 00 45 00  01 a9 01 00 00 00 40 11  78 45 00 00 00 00 ff ff  ff ff 00 00 00 00 00 00  00 00

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20180209190340.19516-1-marcandre.lureau@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/net/net_tx_pkt.c
include/net/eth.h