svn commit: r217859 - head/sbin/iscontrol

Martin Cracauer cracauer at FreeBSD.org
Tue Jan 25 22:25:17 UTC 2011


Author: cracauer
Date: Tue Jan 25 22:25:16 2011
New Revision: 217859
URL: http://svn.freebsd.org/changeset/base/217859

Log:
  Fix compilation with debug on.
  Fix segfault when TargetAddress is missing or mis-spelled in config file.

Modified:
  head/sbin/iscontrol/config.c
  head/sbin/iscontrol/fsm.c

Modified: head/sbin/iscontrol/config.c
==============================================================================
--- head/sbin/iscontrol/config.c	Tue Jan 25 22:21:05 2011	(r217858)
+++ head/sbin/iscontrol/config.c	Tue Jan 25 22:25:16 2011	(r217859)
@@ -295,7 +295,7 @@ keyLookup(char *key)
 {
      textkey_t	*tk;
 
-     for(tk = keyMap; tk->name; tk++) {
+     for(tk = keyMap; tk->name && strcmp(tk->name, "end"); tk++) {
 	  if(strcasecmp(key, tk->name) == 0)
 	       return tk;
      }

Modified: head/sbin/iscontrol/fsm.c
==============================================================================
--- head/sbin/iscontrol/fsm.c	Tue Jan 25 22:21:05 2011	(r217858)
+++ head/sbin/iscontrol/fsm.c	Tue Jan 25 22:25:16 2011	(r217859)
@@ -359,8 +359,8 @@ doCAM(isess_t *sess)
       | for now will do this for each lun ...
       */
      for(n = i = 0; i < sess->cam.target_nluns; i++) {
-	  debug(2, "CAM path_id=%d target_id=%d target_lun=%d",
-		sess->cam.path_id, sess->cam.target_id, sess->cam.target_lun[i]);
+	  debug(2, "CAM path_id=%d target_id=%d",
+		sess->cam.path_id, sess->cam.target_id);
 
 	  sess->camdev = cam_open_btl(sess->cam.path_id, sess->cam.target_id,
 				      i, O_RDWR, NULL);


More information about the svn-src-head mailing list