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