ctld: normalize iSCSI TargetName on login

Case-insensitive TargetName matching on logins was accidentally removed,
let's fix that by normalizing TargetName again according to RFC 3722.

PR: 			294522
Fixes: 			4b1aac9314
Sponsored by: 		ConnectWise
MFC after: 		1 week
Reviewed by:		asomers, jhb
Approved by:		asomers (mentor)
Differential Revision:	https://reviews.freebsd.org/D56469
This commit is contained in:
Johan Söllvander
2026-04-24 09:44:43 +02:00
parent 74dff31069
commit eb837cb8b2
+8 -2
View File
@@ -967,12 +967,18 @@ iscsi_connection::login()
login_send_error(request, 0x02, 0x07);
log_errx(1, "received Login PDU without TargetName");
}
/*
* Normalize target_name according to RFC 3722
*/
std::string t_name(target_name);
for (char &c : t_name)
c = tolower(c);
conn_port = pg->find_port(target_name);
conn_port = pg->find_port(t_name);
if (conn_port == NULL) {
login_send_error(request, 0x02, 0x03);
log_errx(1, "requested target \"%s\" not found",
target_name);
t_name.c_str());
}
conn_target = conn_port->target();
}