qemu-e2k/slirp
Aurelien Jarno 8aaf42ed0f slirp: fix unaligned access in bootp code
Slirp code tries to be smart an avoid data copy by using pointer to
the data. This solution leads to unaligned access, in this case
preq_addr, which is a 32-bit long structure. There is no real point
of avoiding data copy in a such case, as the value itself is smaller
or the same size as a pointer.

The patch replaces pointers to the preq_addr structure by the strcture
itself, and use the address 0.0.0.0 if no address has been requested
(this is not a valid address in such a request). It compares it with
htonl(0L) for correctness reasons, in case a code checker look for such
mistakes. It also uses memcpy() for copying the data, which takes care
of alignement issues.

This fixes an unaligned access on IA64 host while requesting a DHCP
address.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-10 10:56:25 +01:00
..
bootp.c slirp: fix unaligned access in bootp code 2011-01-10 10:56:25 +01:00
bootp.h
cksum.c
COPYRIGHT
debug.h
if.c
if.h
ip_icmp.c
ip_icmp.h
ip_input.c
ip_output.c
ip.h
libslirp.h
main.h
mbuf.c
mbuf.h
misc.c slirp: Remove unused code for bad sprintf 2010-11-21 09:16:57 -06:00
misc.h
sbuf.c
sbuf.h
slirp_config.h slirp: Remove unused code for bad sprintf 2010-11-21 09:16:57 -06:00
slirp.c
slirp.h slirp: Remove unused code for bad sprintf 2010-11-21 09:16:57 -06:00
socket.c
socket.h
tcp_input.c
tcp_output.c
tcp_subr.c
tcp_timer.c
tcp_timer.h
tcp_var.h
tcp.h
tcpip.h
tftp.c
tftp.h
udp.c
udp.h