[Pkg-iscsi-maintainers] [SCM] Debian Open-iSCSI Packaging branch, upstream-mnc, updated. 2.0-872-193-gde2c0e7

Mike Christie michaelc at cs.wisc.edu
Sat Apr 7 15:43:54 UTC 2012


The following commit has been merged in the upstream-mnc branch:
commit 304ed371122570a2af6106ed800bca56ddb0d1e1
Author: Mike Christie <michaelc at cs.wisc.edu>
Date:   Thu Oct 6 04:17:42 2011 -0500

    iscsi tools: fix up vlan support
    
    This syncs userspace up with what has been sent to linux-scsi
    by fixing:
    
    1. link_local_autocfg sysfs file naming.
    2. init vlan, port and mtu sysfs handling so that they are
    initialized to 0 on failure to read them.
    3. Change ISCSI_NET_PARAM_VLAN_ID to ISCSI_NET_PARAM_VLAN_TAG
    because we are setting the tag and not just the id.

diff --git a/include/iscsi_if.h b/include/iscsi_if.h
index 0a96080..28447df 100644
--- a/include/iscsi_if.h
+++ b/include/iscsi_if.h
@@ -320,10 +320,11 @@ enum iscsi_net_param {
 	ISCSI_NET_PARAM_VLAN_ID			= 13,
 	ISCSI_NET_PARAM_VLAN_PRIORITY		= 14,
 	ISCSI_NET_PARAM_VLAN_ENABLED		= 15,
-	ISCSI_NET_PARAM_IFACE_TYPE		= 16,
-	ISCSI_NET_PARAM_IFACE_NAME		= 17,
-	ISCSI_NET_PARAM_MTU			= 18,
-	ISCSI_NET_PARAM_PORT			= 19,
+	ISCSI_NET_PARAM_VLAN_TAG		= 16,
+	ISCSI_NET_PARAM_IFACE_TYPE		= 17,
+	ISCSI_NET_PARAM_IFACE_NAME		= 18,
+	ISCSI_NET_PARAM_MTU			= 19,
+	ISCSI_NET_PARAM_PORT			= 20,
 };
 
 enum iscsi_conn_state {
diff --git a/usr/host.c b/usr/host.c
index 60f67a7..007d546 100644
--- a/usr/host.c
+++ b/usr/host.c
@@ -145,9 +145,10 @@ static int print_host_iface(void *data, struct iface_rec *iface)
 		printf("%sRouter Address: [%s]\n", prefix, iface->ipv6_router);
 	}
 
+	printf("%sPort: %u\n", prefix, iface->port);
 	printf("%sMTU: %u\n", prefix, iface->mtu);
-	printf("%svlan ID: %u\n", prefix, iface->vlan_id);
-	printf("%svlan priority: %u\n", prefix, iface->vlan_priority);
+	printf("%sVLAN ID: %u\n", prefix, iface->vlan_id);
+	printf("%sVLAN priority: %u\n", prefix, iface->vlan_priority);
 	return 0;
 }
 
diff --git a/usr/iface.c b/usr/iface.c
index a42efff..37840a9 100644
--- a/usr/iface.c
+++ b/usr/iface.c
@@ -1203,14 +1203,14 @@ static int iface_fill_vlan_id(struct iovec *iov, struct iface_rec *iface,
 	struct nlattr *attr;
 
 	len = sizeof(struct iscsi_iface_param_info) + 2;
-	iov->iov_base = iscsi_nla_alloc(ISCSI_NET_PARAM_VLAN_ID, len);
+	iov->iov_base = iscsi_nla_alloc(ISCSI_NET_PARAM_VLAN_TAG, len);
 	if (!(iov->iov_base))
 		return 1;
 
 	attr = iov->iov_base;
 	iov->iov_len = NLA_ALIGN(attr->nla_len);
 	net_param = (struct iscsi_iface_param_info *)ISCSI_NLA_DATA(attr);
-	net_param->param = ISCSI_NET_PARAM_VLAN_ID;
+	net_param->param = ISCSI_NET_PARAM_VLAN_TAG;
 	net_param->iface_type = iface_type;
 	net_param->iface_num = iface->iface_num;
 	net_param->param_type = ISCSI_NET_PARAM;
diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c
index 961cefd..a5c161b 100644
--- a/usr/iscsi_sysfs.c
+++ b/usr/iscsi_sysfs.c
@@ -561,28 +561,27 @@ static int iscsi_sysfs_read_iface(struct iface_rec *iface, int host_no,
 			      "link_local_addr", iface->ipv6_linklocal,
 			      sizeof(iface->ipv6_linklocal));
 
-		if (sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS,
-				  "linklocal_autocfg",
-				   iface->linklocal_autocfg,
-				   sizeof(iface->linklocal_autocfg))) {
-			/* misspelled in some test kernels */
-			sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS,
-				      "link_local_autocfg",
-				      iface->linklocal_autocfg,
-				      sizeof(iface->linklocal_autocfg));
-		}
+		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS,
+			      "link_local_autocfg", iface->linklocal_autocfg,
+			      sizeof(iface->linklocal_autocfg));
 
 		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "router_addr",
 			      iface->ipv6_router,
 			      sizeof(iface->ipv6_router));
 	}
 
-	sysfs_get_uint16(iface_kern_id, ISCSI_IFACE_SUBSYS, "mtu",
-			 &iface->mtu);
-	sysfs_get_uint16(iface_kern_id, ISCSI_IFACE_SUBSYS, "vlan",
-			 &iface->vlan_id);
-	sysfs_get_uint8(iface_kern_id, ISCSI_IFACE_SUBSYS, "vlan_priority",
-			 &iface->vlan_priority);
+	if (sysfs_get_uint16(iface_kern_id, ISCSI_IFACE_SUBSYS, "port",
+			     &iface->port))
+		iface->port = 0;
+	if (sysfs_get_uint16(iface_kern_id, ISCSI_IFACE_SUBSYS, "mtu",
+			     &iface->mtu))
+		iface->mtu = 0;
+	if (sysfs_get_uint16(iface_kern_id, ISCSI_IFACE_SUBSYS, "vlan_id",
+			     &iface->vlan_id))
+		iface->vlan_id = 0;
+	if (sysfs_get_uint8(iface_kern_id, ISCSI_IFACE_SUBSYS, "vlan_priority",
+			    &iface->vlan_priority))
+		iface->vlan_priority = 0;
 
 	if (sscanf(iface_kern_id, "ipv%d-iface-%u-%u", &iface_type,
 		   &tmp_host_no, &iface_num) == 3)

-- 
Debian Open-iSCSI Packaging



More information about the Pkg-iscsi-maintainers mailing list