From patchwork Wed Mar 13 14:56:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tangwenji X-Patchwork-Id: 10851327 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F0ECA13B5 for ; Wed, 13 Mar 2019 15:01:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D727829ED0 for ; Wed, 13 Mar 2019 15:01:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D550929F1D; Wed, 13 Mar 2019 15:01:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BCC3529ED0 for ; Wed, 13 Mar 2019 15:01:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725876AbfCMPB5 (ORCPT ); Wed, 13 Mar 2019 11:01:57 -0400 Received: from m12-15.163.com ([220.181.12.15]:50247 "EHLO m12-15.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725832AbfCMPB5 (ORCPT ); Wed, 13 Mar 2019 11:01:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=SSsbmQJVpYJ7FXVjsa RKxAITCZnk31n2DPmuSusBGns=; b=L2RHkNyPPqPM2DLtDoHY5NKfUhKZWKnX4D wWCcln+ubLmbtvzyyqNcAAAeIFgPdMMdVt07mQDpNJabgLpJ4jIhBbE7vdNa89Qr JM+Ym0w3UD9Qs8neaLKy+ASTmiG50K+35AZppypW+Q8eD/7RP7ymWOJr6TiDa3Ly ajdRqo+BU= Received: from localhost.localdomain (unknown [113.246.161.214]) by smtp11 (Coremail) with SMTP id D8CowABnlMD4GYlcAWziBQ--.40756S2; Wed, 13 Mar 2019 22:55:54 +0800 (CST) From: tangwenji To: "Martin K. Petersen" Cc: target-devel@vger.kernel.org, tangwenji Subject: [PATCH] target:iscsi:fix np_ip_proto and np_sock_type in iscsit_setup_np Date: Wed, 13 Mar 2019 22:56:38 +0800 Message-Id: <1552488998-3604-1-git-send-email-hndksztwj@163.com> X-Mailer: git-send-email 2.5.0.windows.1 X-CM-TRANSID: D8CowABnlMD4GYlcAWziBQ--.40756S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Xw4UKr48WFWUury3AF4ruFg_yoWfWFg_Cw 1jq3429r1093Z3trWqka4DZF909r97Wr4IyFWvyw4fKry7X3Z5tFyqqF1fZr97Z3WkXryF k347ZrWUGF4kJjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUnEtC5UUUUU== X-Originating-IP: [113.246.161.214] X-CM-SenderInfo: 5kqgy2h2wzyqqrwthudrp/xtbB0x12Q1XljJm0GgAAsw Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: tangwenji 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. Signed-off-by: tangwenji Reviewed-by: Mike Christie --- drivers/target/iscsi/iscsi_target_login.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c index ae3209e..c526e66 100644 --- a/drivers/target/iscsi/iscsi_target_login.c +++ b/drivers/target/iscsi/iscsi_target_login.c @@ -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) {