nvmet-tcp: peek icreq before starting TLS
authorHannes Reinecke <hare@suse.de>
Thu, 24 Aug 2023 14:39:25 +0000 (16:39 +0200)
committerKeith Busch <kbusch@kernel.org>
Wed, 11 Oct 2023 17:29:59 +0000 (10:29 -0700)
commit70525e5d82f62407d8436aa2a6c3385829ab5a3e
tree490f5385370a6e4ad46d2838063f0a730192a545
parenta1c5dd8355b172b44a4ff8248fb487006236a918
nvmet-tcp: peek icreq before starting TLS

Incoming connection might be either 'normal' NVMe-TCP connections
starting with icreq or TLS handshakes. To ensure that 'normal'
connections can still be handled we need to peek the first packet
and only start TLS handshake if it's not an icreq.
With that we can lift the restriction to always set TREQ to
'required' when TLS1.3 is enabled.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/target/configfs.c
drivers/nvme/target/nvmet.h
drivers/nvme/target/tcp.c