]> git.proxmox.com Git - qemu.git/commit - slirp/mbuf.h
slirp: Fix packet expiration
authorThomas Huth <thuth@linux.vnet.ibm.com>
Tue, 27 Sep 2011 09:20:38 +0000 (11:20 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Wed, 28 Sep 2011 11:11:30 +0000 (13:11 +0200)
commit2b4404326598bec4cb954bfc54fc5e9740a51f7b
tree39fb0d0b4dd9be56c125e389744da5b9bcc1fb10
parent8d06d69bc448301d27cab1405efba9d876dd39da
slirp: Fix packet expiration

The two new variables "arp_requested" and "expiration_date" in the mbuf
structure have been added after the variable-sized "m_dat_" array. The
variables have to be added before the m_dat_ array instead.
Without this patch, the expiration_date gets clobbered by code that
accesses the m_dat_ array.
I experienced this problem with the code in slirp/tftp.c: The
tftp_send_data() function created a new packet with the m_get()
function (which fills-in a default expiration_date value). Then the
TFTP code cleared the data section of the packet, which accidentially
also cleared the expiration_date. This zeroed expiration_date then
finally causes the packet to be discarded during if_start(), so that
TFTP packets were not transmitted anymore.

[Jan: added comment as suggested by Fabien ]

CC: Fabien Chouteau <chouteau@adacore.com>
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
slirp/mbuf.h