Date: Fri, 11 Oct 2013 17:10:28 +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: r256318 - stable/10/sbin/camcontrol Message-ID: <201310111710.r9BHASCn091876@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Fri Oct 11 17:10:28 2013 New Revision: 256318 URL: http://svnweb.freebsd.org/changeset/base/256318 Log: MFC r256317: Fix mode page length calculation to remove last garbage line from the `camcontrol mode daX -l` output. Approved by: re (gjb) Modified: stable/10/sbin/camcontrol/modeedit.c Directory Properties: stable/10/sbin/camcontrol/ (props changed) Modified: stable/10/sbin/camcontrol/modeedit.c ============================================================================== --- stable/10/sbin/camcontrol/modeedit.c Fri Oct 11 17:00:09 2013 (r256317) +++ stable/10/sbin/camcontrol/modeedit.c Fri Oct 11 17:10:28 2013 (r256318) @@ -886,12 +886,12 @@ mode_list(struct cam_device *device, int timeout, data, sizeof(data)); mh = (struct scsi_mode_header_6 *)data; - len = mh->blk_desc_len; /* Skip block descriptors. */ + len = sizeof(*mh) + mh->blk_desc_len; /* Skip block descriptors. */ /* Iterate through the pages in the reply. */ while (len < mh->data_length) { /* Locate the next mode page header. */ mph = (struct scsi_mode_page_header *) - ((intptr_t)mh + sizeof(*mh) + len); + ((intptr_t)mh + len); mph->page_code &= SMS_PAGE_CODE; nameentry = nameentry_lookup(mph->page_code);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310111710.r9BHASCn091876>