Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Jun 2014 10:04:44 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r267500 - head/sys/cam/ctl
Message-ID:  <201406151004.s5FA4iD7049338@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sun Jun 15 10:04:44 2014
New Revision: 267500
URL: http://svnweb.freebsd.org/changeset/base/267500

Log:
  Format Portal Group Tag same as istgt does -- %4.4x instead of %x.
  
  SPC-4 spec tells it should be "two or more hexadecimal digits".
  RFC3720 tells it is 16-bit value.
  
  MFC after:	2 weeks

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Sun Jun 15 09:37:06 2014	(r267499)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Sun Jun 15 10:04:44 2014	(r267500)
@@ -2046,7 +2046,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 	cs = PDU_SESSION(request);
 
 	wwpn_len = strlen(cs->cs_target->ct_name);
-	wwpn_len += strlen(",t,0x01");
+	wwpn_len += strlen(",t,0x0001");
 	wwpn_len += 1; /* '\0' */
 	if ((wwpn_len % 4) != 0)
 		wwpn_len += (4 - (wwpn_len % 4));
@@ -2135,7 +2135,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 	desc1->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT |
 	    SVPD_ID_TYPE_SCSI_NAME;
 	desc1->length = wwpn_len;
-	snprintf(desc1->identifier, wwpn_len, "%s,t,0x%x",
+	snprintf(desc1->identifier, wwpn_len, "%s,t,0x%4.4x",
 	    cs->cs_target->ct_name, cs->cs_portal_group_tag);
 
 	/*



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