Commit 2508d170 authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

sock: make opts structures packed



This ensures that when fields are added, that the
size of the structure will change, ensuring different
versions of the structure can be detected using
sizeof.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: Ia30d57b25b559a89997963a3f68797ff3b9d6409
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14093


Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
parent 1ef25810
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -175,11 +175,17 @@ struct spdk_sock_opts {
	 */
	bool zcopy;

	/* Hole at bytes 13-15. */
	uint8_t reserved13[3];

	/**
	 * Time in msec to wait ack until connection is closed forcefully.
	 */
	uint32_t ack_timeout;

	/* Hole at bytes 20-23. */
	uint8_t reserved[4];

	/**
	 * Socket implementation options.  If non-NULL, these will override those set by
	 * spdk_sock_impl_set_opts().  The library copies this structure internally, so the user can
@@ -191,7 +197,7 @@ struct spdk_sock_opts {
	 * Size of the impl_opts structure.
	 */
	size_t impl_opts_size;
};
} __attribute__((packed));
SPDK_STATIC_ASSERT(sizeof(struct spdk_sock_opts) == 40, "Incorrect size");

/**