vhost: bad packet assembled from descriptor chaining 37/6737/1
authorSteven <[email protected]>
Wed, 17 May 2017 04:26:13 +0000 (21:26 -0700)
committerDamjan Marion <[email protected]>
Wed, 17 May 2017 09:50:27 +0000 (11:50 +0200)
commit1da79ed89942dd27ea1d7c74311b91d02624722d
tree31979e991dd42bddd195b0b1b2c8cf87d2c20313
parent99c0734e54f16456aed0c35b464d6d165e26d9b1
vhost: bad packet assembled from descriptor chaining

When the descriptor is chained via multiple parts, vhost is supposed
to reassemble the different parts to form a packet prior to passing
the packet to the next input node. However, bad packet was seen, having
bad ethertype, source, and destination mac addresses.

The problem was due to the destination pointer not being incremented as
each chain is processed. THe result was the first chain is copied to the
beginning of the buffer, the next chain is copied, then the last chain
is also copied to the beginning of the buffer. As a result, the ethertype,
source and destination mac, etc, are being overwritten by the very last
chain of the descriptor.

Change-Id: I78f9a91de68c85574047912576dcc311d7597e21
Signed-off-by: Steven <[email protected]>
src/vnet/devices/virtio/vhost-user.c