mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-30 08:43:23 +00:00
libnvmf: Reject invalid values of MAXH2CDATA for new associations
Sponsored by: Chelsio Communications
This commit is contained in:
parent
fd0e6af5e4
commit
846d702f23
@ -924,11 +924,18 @@ nvmf_tcp_read_ic_resp(struct nvmf_association *na, struct nvmf_tcp_qpair *qp,
|
||||
}
|
||||
|
||||
static struct nvmf_association *
|
||||
tcp_allocate_association(bool controller __unused,
|
||||
const struct nvmf_association_params *params __unused)
|
||||
tcp_allocate_association(bool controller,
|
||||
const struct nvmf_association_params *params)
|
||||
{
|
||||
struct nvmf_tcp_association *ta;
|
||||
|
||||
if (controller) {
|
||||
/* 7.4.10.3 */
|
||||
if (params->tcp.maxh2cdata < 4096 ||
|
||||
params->tcp.maxh2cdata % 4 != 0)
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
ta = calloc(1, sizeof(*ta));
|
||||
|
||||
return (&ta->na);
|
||||
|
Loading…
Reference in New Issue
Block a user