vhost: access VhostUsrMsg via packed struct
authorDaniel Verkamp <daniel.verkamp@intel.com>
Fri, 26 May 2017 11:59:15 +0000 (13:59 +0200)
committerYuanhan Liu <yliu@fridaylinux.org>
Fri, 16 Jun 2017 12:04:25 +0000 (14:04 +0200)
commit368c6625b6d6da2a8280f4c5de90b4404a157d84
treec78ee0d66cab5ca28bb48dc8dcc38951837d2b20
parent29c7c2fdaa4e88eebee6e3abaa15858d9616b1aa
vhost: access VhostUsrMsg via packed struct

Accessing fields of a packed struct through unaligned pointers is
undefined behavior. Instead of passing pointers to particular fields,
a pointer to the root struct should be used. This patch does exactly
that.

Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
lib/librte_vhost/vhost_user.c