Blame SOURCES/0051-iscsi-tools-Let-default-type-of-iface-be-ipv4.patch

786c6d
From 75ee9d0af6e200b34e84b1e7b37971213b2fd629 Mon Sep 17 00:00:00 2001
786c6d
From: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
786c6d
Date: Fri, 18 Oct 2013 09:29:26 -0400
786c6d
Subject: [PATCH] iscsi tools: Let default type of iface be ipv4
786c6d
786c6d
While using iface name to determine its type if the name does not
786c6d
contain iface type then assume it be to of type ipv4 by default.
786c6d
786c6d
Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
786c6d
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
786c6d
---
786c6d
 usr/iface.c | 4 +++-
786c6d
 1 file changed, 3 insertions(+), 1 deletion(-)
786c6d
786c6d
diff --git a/usr/iface.c b/usr/iface.c
786c6d
index 87ac875..870dba0 100644
786c6d
--- a/usr/iface.c
786c6d
+++ b/usr/iface.c
786c6d
@@ -450,8 +450,10 @@ int iface_get_iptype(struct iface_rec *iface)
786c6d
 		/* try to figure out by name */
786c6d
 		if (strstr(iface->name, "ipv4"))
786c6d
 			return ISCSI_IFACE_TYPE_IPV4;
786c6d
-		else
786c6d
+		else if (strstr(iface->name, "ipv6"))
786c6d
 			return ISCSI_IFACE_TYPE_IPV6;
786c6d
+		else	/* assume ipv4 by default */
786c6d
+			return ISCSI_IFACE_TYPE_IPV4;
786c6d
 	} else {
786c6d
 		if (strcmp(iface->bootproto, "dhcp") &&
786c6d
 		    !strstr(iface->ipaddress, "."))
786c6d
-- 
786c6d
1.8.3.1
786c6d