Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Aug 2015 11:08:31 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r286801 - stable/10/usr.sbin/ctld
Message-ID:  <201508151108.t7FB8VkM016648@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sat Aug 15 11:08:30 2015
New Revision: 286801
URL: https://svnweb.freebsd.org/changeset/base/286801

Log:
  MFC r286456: Remove some code duplication.

Modified:
  stable/10/usr.sbin/ctld/login.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/ctld/login.c
==============================================================================
--- stable/10/usr.sbin/ctld/login.c	Sat Aug 15 11:05:44 2015	(r286800)
+++ stable/10/usr.sbin/ctld/login.c	Sat Aug 15 11:08:30 2015	(r286801)
@@ -59,6 +59,7 @@ login_set_nsg(struct pdu *response, int 
 
 	bhslr->bhslr_flags &= 0xFC;
 	bhslr->bhslr_flags |= nsg;
+	bhslr->bhslr_flags |= BHSLR_FLAGS_TRANSIT;
 }
 
 static int
@@ -339,15 +340,12 @@ login_send_chap_success(struct pdu *requ
 {
 	struct pdu *response;
 	struct keys *request_keys, *response_keys;
-	struct iscsi_bhs_login_response *bhslr2;
 	struct rchap *rchap;
 	const char *chap_i, *chap_c;
 	char *chap_r;
 	int error;
 
 	response = login_new_response(request);
-	bhslr2 = (struct iscsi_bhs_login_response *)response->pdu_bhs;
-	bhslr2->bhslr_flags |= BHSLR_FLAGS_TRANSIT;
 	login_set_nsg(response, BHSLR_STAGE_OPERATIONAL_NEGOTIATION);
 
 	/*
@@ -705,7 +703,6 @@ login_negotiate(struct connection *conn,
 
 	response = login_new_response(request);
 	bhslr2 = (struct iscsi_bhs_login_response *)response->pdu_bhs;
-	bhslr2->bhslr_flags |= BHSLR_FLAGS_TRANSIT;
 	bhslr2->bhslr_tsih = htons(0xbadd);
 	login_set_csg(response, BHSLR_STAGE_OPERATIONAL_NEGOTIATION);
 	login_set_nsg(response, BHSLR_STAGE_FULL_FEATURE_PHASE);
@@ -745,7 +742,6 @@ login(struct connection *conn)
 {
 	struct pdu *request, *response;
 	struct iscsi_bhs_login_request *bhslr;
-	struct iscsi_bhs_login_response *bhslr2;
 	struct keys *request_keys, *response_keys;
 	struct auth_group *ag;
 	struct portal_group *pg;
@@ -906,8 +902,6 @@ login(struct connection *conn)
 			    "transitioning anyway");
 
 		response = login_new_response(request);
-		bhslr2 = (struct iscsi_bhs_login_response *)response->pdu_bhs;
-		bhslr2->bhslr_flags |= BHSLR_FLAGS_TRANSIT;
 		login_set_nsg(response, BHSLR_STAGE_OPERATIONAL_NEGOTIATION);
 		response_keys = keys_new();
 		/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508151108.t7FB8VkM016648>