svn commit: r274546 - stable/10/sys/dev/iscsi

Edward Tomasz Napierala trasz at FreeBSD.org
Sat Nov 15 05:50:15 UTC 2014


Author: trasz
Date: Sat Nov 15 05:50:14 2014
New Revision: 274546
URL: https://svnweb.freebsd.org/changeset/base/274546

Log:
  MFC r273164:
  
  When removing an iSCSI session, check whether all conditions match,
  not if any of them matches.  This fixes "iscsictl -Rn" removing
  unrelated sessions.
  
  PR:		194034
  Sponsored by:	The FreeBSD Foundation

Modified:
  stable/10/sys/dev/iscsi/iscsi.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/iscsi/iscsi.c
==============================================================================
--- stable/10/sys/dev/iscsi/iscsi.c	Sat Nov 15 05:40:20 2014	(r274545)
+++ stable/10/sys/dev/iscsi/iscsi.c	Sat Nov 15 05:50:14 2014	(r274546)
@@ -1757,18 +1757,16 @@ static bool
 iscsi_session_conf_matches(unsigned int id1, const struct iscsi_session_conf *c1,
     unsigned int id2, const struct iscsi_session_conf *c2)
 {
-	if (id2 == 0 && c2->isc_target[0] == '\0' &&
-	    c2->isc_target_addr[0] == '\0')
-		return (true);
-	if (id2 != 0 && id2 == id1)
-		return (true);
+
+	if (id2 != 0 && id2 != id1)
+		return (false);
 	if (c2->isc_target[0] != '\0' &&
-	    strcmp(c1->isc_target, c2->isc_target) == 0)
-		return (true);
+	    strcmp(c1->isc_target, c2->isc_target) != 0)
+		return (false);
 	if (c2->isc_target_addr[0] != '\0' &&
-	    strcmp(c1->isc_target_addr, c2->isc_target_addr) == 0)
-		return (true);
-	return (false);
+	    strcmp(c1->isc_target_addr, c2->isc_target_addr) != 0)
+		return (false);
+	return (true);
 }
 
 static int


More information about the svn-src-all mailing list