iscsi-initiator-utils/0131-iscsiadm-Fix-the-hostno-check-for-stats-submode-of-h.patch
Chris Leech 4b292f8a07 host0 being treated as an invalid in the host stats command
revert change to return code when calling login_portal for sessions that
already exist, as it impacts users scripting around iscsiadm

Resolves: #1049710 #1015563
2014-02-25 21:31:25 -08:00

31 lines
885 B
Diff

From 8de8ce551cbdb1250b696a5eedc5cff2b68e71e8 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Mon, 24 Feb 2014 03:14:17 -0500
Subject: [PATCH] iscsiadm: Fix the hostno check for stats submode of host mode
This fixes the condition where hostno value of 0 was being treated
as invalid.
Signed-off-by: Chris Leech <cleech@redhat.com>
Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
---
usr/iscsiadm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
index 3cde8d1..36617ab 100644
--- a/usr/iscsiadm.c
+++ b/usr/iscsiadm.c
@@ -3470,7 +3470,7 @@ main(int argc, char **argv)
&params);
break;
case MODE_HOST_STATS:
- if (!host_no) {
+ if (host_no > MAX_HOST_NO) {
log_error("STATS mode requires host no");
rc = ISCSI_ERR_INVAL;
break;
--
1.8.3.1