]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
iscsid: set max_recv_data_segment_length to what we advertise
authorEd Maste <emaste@FreeBSD.org>
Thu, 21 Oct 2021 15:09:58 +0000 (11:09 -0400)
committerEd Maste <emaste@FreeBSD.org>
Mon, 25 Oct 2021 20:25:15 +0000 (16:25 -0400)
commitfc79cf4fea7221fa62d480648f05e30f7df73f92
tree37faaa2f60c1b2d3379fe160a1f08ec7cdf6491f
parent548ada00e54a9e7745d041b1ec7f68f3bd493365
iscsid: set max_recv_data_segment_length to what we advertise

Previously we updated the conection's conn_max_recv_data_segment_length
only when we received a response containing MaxRecvDataSegmentLength
from the target.  If the target did not send MaxRecvDataSegmentLength
then we left conn_max_recv_data_segment_length at the default (i.e.,
8192).  A target could then send more data than that defult (up to our
advertised maximum), and we would drop the connection.

RFC 7143 specifies that MaxRecvDataSegmentLength is Declarative, not
negotiated.  Just set conn_max_recv_data_segment_length to our
advertised value in login_negotiate().

PR: 259355
Reviewed by: mav
MFC after: 1 week
Fixes: a15fbc904a4d ("Alike to r312190 decouple iSCSI...")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32605
usr.sbin/iscsid/login.c