Skip to contentSkip to conversation

target:iscsi:fix np_ip_proto and np_sock_type in iscsit_setup_np

PATCH Applied tangwenji 3 participants 3 messages Mar 13, 2019 – Mar 21, 2019 SCSI target

lore
Share & tools
lore

tangwenji

author
#0 lore raw

PATCH 1/1 target:iscsi:fix np_ip_proto and np_sock_type in iscsit_setup_np

From: tangwenji <[email protected]>

In the switch, np_ip_proto and np_sock_type set different values according to np_network_transport, and then uniformly assign values, so the previous values are overwritten.

---
 drivers/target/iscsi/iscsi_target_login.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/target/iscsi/iscsi_target_login.c +0 -3
index ae3209e..c526e66 100644
@@ -883,9 +883,6 @@ int iscsit_setup_np(
 		return -EINVAL;
 	}
 
-	np->np_ip_proto = IPPROTO_TCP;
-	np->np_sock_type = SOCK_STREAM;
-
 	ret = sock_create(sockaddr->ss_family, np->np_sock_type,
 			np->np_ip_proto, &sock);
 	if (ret < 0) {
Signature · 1 line
2.5.0.windows.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · tangwenji

From: tangwenji <[email protected]>

In the switch, np_ip_proto and np_sock_type set different values according to np_network_transport, and then uniformly assign values, so the previous values are overwritten.

---
 drivers/target/iscsi/iscsi_target_login.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/target/iscsi/iscsi_target_login.c +0 -0
index ae3209e..c526e66 100644

drivers/target/iscsi/iscsi_target_login.c int iscsit_setup_np( · line 888

Quoted 9 lines
drivers/target/iscsi/iscsi_target_login.c +0 -3
@@ -883,9 +883,6 @@ int iscsit_setup_np(
 		return -EINVAL;
 	}
 
-	np->np_ip_proto = IPPROTO_TCP;
-	np->np_sock_type = SOCK_STREAM;
-
 	ret = sock_create(sockaddr->ss_family, np->np_sock_type,
 			np->np_ip_proto, &sock);
 	if (ret < 0) {

This got added in 2013:

commit baa4d64b147a4064626f6597646ae8a330d9e2ed

Author: Nicholas Bellinger <[email protected]>
Date:   Wed Mar 6 21:54:13 2013 -0800

iscsi-target: Initial traditional TCP conversion to iscsit_transport

so I guess SCTP does not get used a lot, or it somehow worked still. I do not have a SCTP initiator to test, but it looks ok to me since it looks like the original code.

#2 lore raw
In reply to tangwenji

tangwenji,

Quoted 3 lines

In the switch, np_ip_proto and np_sock_type set different values according to np_network_transport, and then uniformly assign values, so the previous values are overwritten.

Applied to 5.2/scsi-queue, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering