additional parameters for network configuration
Resolves: #948134 Signed-off-by: Chris Leech <cleech@redhat.com>
This commit is contained in:
parent
11189d126b
commit
a288e4f537
@ -0,0 +1,46 @@
|
||||
From 0a95bc409c6282b95c48ba39a16e17c3e6e26537 Mon Sep 17 00:00:00 2001
|
||||
From: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
|
||||
Date: Fri, 18 Oct 2013 09:29:17 -0400
|
||||
Subject: [PATCH] iscsi tools: Setup iface conf file with all iface attrs
|
||||
exported in sysfs
|
||||
|
||||
Currently, iface conf file does not get populated with all the iface
|
||||
attrs that are exported in corresponding sysfs entry.
|
||||
This patch allows to setup conf file with all iface attrs in sysfs.
|
||||
|
||||
Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
|
||||
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
|
||||
---
|
||||
usr/iface.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/usr/iface.c b/usr/iface.c
|
||||
index c86892e..8580d1a 100644
|
||||
--- a/usr/iface.c
|
||||
+++ b/usr/iface.c
|
||||
@@ -476,11 +476,8 @@ static int iface_setup_binding_from_kern_iface(void *data,
|
||||
}
|
||||
|
||||
memset(&iface, 0, sizeof(struct iface_rec));
|
||||
- strcpy(iface.hwaddress, hinfo->iface.hwaddress);
|
||||
- strcpy(iface.transport_name, hinfo->iface.transport_name);
|
||||
-
|
||||
if (kern_iface) {
|
||||
- iface.iface_num = kern_iface->iface_num;
|
||||
+ memcpy(&iface, kern_iface, sizeof(iface));
|
||||
|
||||
snprintf(iface.name, sizeof(iface.name), "%s.%s.%s.%u",
|
||||
kern_iface->transport_name,
|
||||
@@ -492,6 +489,9 @@ static int iface_setup_binding_from_kern_iface(void *data,
|
||||
hinfo->iface.transport_name, hinfo->iface.hwaddress);
|
||||
}
|
||||
|
||||
+ strcpy(iface.hwaddress, hinfo->iface.hwaddress);
|
||||
+ strcpy(iface.transport_name, hinfo->iface.transport_name);
|
||||
+
|
||||
memset(iface_path, 0, sizeof(iface_path));
|
||||
snprintf(iface_path, PATH_MAX, "%s/%s", IFACE_CONFIG_DIR,
|
||||
iface.name);
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,65 @@
|
||||
From 026c8d771c1df457cd26e7066b503cadfbbc98df Mon Sep 17 00:00:00 2001
|
||||
From: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
|
||||
Date: Fri, 18 Oct 2013 09:29:18 -0400
|
||||
Subject: [PATCH] iscsi_if.h: Remove numbers used for network parameter
|
||||
settings
|
||||
|
||||
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
|
||||
Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
|
||||
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
|
||||
---
|
||||
include/iscsi_if.h | 38 +++++++++++++++++++-------------------
|
||||
1 file changed, 19 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/include/iscsi_if.h b/include/iscsi_if.h
|
||||
index 0284662..e837dd0 100644
|
||||
--- a/include/iscsi_if.h
|
||||
+++ b/include/iscsi_if.h
|
||||
@@ -395,25 +395,25 @@ struct iscsi_path {
|
||||
/* iSCSI network params */
|
||||
enum iscsi_net_param {
|
||||
ISCSI_NET_PARAM_IPV4_ADDR = 1,
|
||||
- ISCSI_NET_PARAM_IPV4_SUBNET = 2,
|
||||
- ISCSI_NET_PARAM_IPV4_GW = 3,
|
||||
- ISCSI_NET_PARAM_IPV4_BOOTPROTO = 4,
|
||||
- ISCSI_NET_PARAM_MAC = 5,
|
||||
- ISCSI_NET_PARAM_IPV6_LINKLOCAL = 6,
|
||||
- ISCSI_NET_PARAM_IPV6_ADDR = 7,
|
||||
- ISCSI_NET_PARAM_IPV6_ROUTER = 8,
|
||||
- ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG = 9,
|
||||
- ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG = 10,
|
||||
- ISCSI_NET_PARAM_IPV6_ROUTER_AUTOCFG = 11,
|
||||
- ISCSI_NET_PARAM_IFACE_ENABLE = 12,
|
||||
- ISCSI_NET_PARAM_VLAN_ID = 13,
|
||||
- ISCSI_NET_PARAM_VLAN_PRIORITY = 14,
|
||||
- ISCSI_NET_PARAM_VLAN_ENABLED = 15,
|
||||
- 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,
|
||||
+ ISCSI_NET_PARAM_IPV4_SUBNET,
|
||||
+ ISCSI_NET_PARAM_IPV4_GW,
|
||||
+ ISCSI_NET_PARAM_IPV4_BOOTPROTO,
|
||||
+ ISCSI_NET_PARAM_MAC,
|
||||
+ ISCSI_NET_PARAM_IPV6_LINKLOCAL,
|
||||
+ ISCSI_NET_PARAM_IPV6_ADDR,
|
||||
+ ISCSI_NET_PARAM_IPV6_ROUTER,
|
||||
+ ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG,
|
||||
+ ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG,
|
||||
+ ISCSI_NET_PARAM_IPV6_ROUTER_AUTOCFG,
|
||||
+ ISCSI_NET_PARAM_IFACE_ENABLE,
|
||||
+ ISCSI_NET_PARAM_VLAN_ID,
|
||||
+ ISCSI_NET_PARAM_VLAN_PRIORITY,
|
||||
+ ISCSI_NET_PARAM_VLAN_ENABLED,
|
||||
+ ISCSI_NET_PARAM_VLAN_TAG,
|
||||
+ ISCSI_NET_PARAM_IFACE_TYPE,
|
||||
+ ISCSI_NET_PARAM_IFACE_NAME,
|
||||
+ ISCSI_NET_PARAM_MTU,
|
||||
+ ISCSI_NET_PARAM_PORT,
|
||||
};
|
||||
|
||||
enum iscsi_conn_state {
|
||||
--
|
||||
1.8.3.1
|
||||
|
122
0044-iscsi_if.h-Additional-parameters-for-network-param-s.patch
Normal file
122
0044-iscsi_if.h-Additional-parameters-for-network-param-s.patch
Normal file
@ -0,0 +1,122 @@
|
||||
From d1e07af2ed3aa480107213378a54bfc9a6a36c0a Mon Sep 17 00:00:00 2001
|
||||
From: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
|
||||
Date: Fri, 18 Oct 2013 09:29:19 -0400
|
||||
Subject: [PATCH] iscsi_if.h: Additional parameters for network param settings
|
||||
|
||||
Added support to display and update additional network parameters
|
||||
through iscsiadm
|
||||
|
||||
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
|
||||
Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
|
||||
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
|
||||
---
|
||||
include/iscsi_if.h | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 79 insertions(+)
|
||||
|
||||
diff --git a/include/iscsi_if.h b/include/iscsi_if.h
|
||||
index e837dd0..e59bcd0 100644
|
||||
--- a/include/iscsi_if.h
|
||||
+++ b/include/iscsi_if.h
|
||||
@@ -320,6 +320,7 @@ enum iscsi_param_type {
|
||||
ISCSI_NET_PARAM, /* iscsi_net_param */
|
||||
ISCSI_FLASHNODE_PARAM, /* iscsi_flashnode_param */
|
||||
ISCSI_CHAP_PARAM, /* iscsi_chap_param */
|
||||
+ ISCSI_IFACE_PARAM, /* iscsi_iface_param */
|
||||
};
|
||||
|
||||
/* structure for minimalist usecase */
|
||||
@@ -392,6 +393,10 @@ struct iscsi_path {
|
||||
#define ISCSI_VLAN_DISABLE 0x01
|
||||
#define ISCSI_VLAN_ENABLE 0x02
|
||||
|
||||
+/* iscsi generic enable/disabled setting for various features */
|
||||
+#define ISCSI_NET_PARAM_DISABLE 0x01
|
||||
+#define ISCSI_NET_PARAM_ENABLE 0x02
|
||||
+
|
||||
/* iSCSI network params */
|
||||
enum iscsi_net_param {
|
||||
ISCSI_NET_PARAM_IPV4_ADDR = 1,
|
||||
@@ -414,6 +419,80 @@ enum iscsi_net_param {
|
||||
ISCSI_NET_PARAM_IFACE_NAME,
|
||||
ISCSI_NET_PARAM_MTU,
|
||||
ISCSI_NET_PARAM_PORT,
|
||||
+ ISCSI_NET_PARAM_IPADDR_STATE,
|
||||
+ ISCSI_NET_PARAM_IPV6_LINKLOCAL_STATE,
|
||||
+ ISCSI_NET_PARAM_IPV6_ROUTER_STATE,
|
||||
+ ISCSI_NET_PARAM_DELAYED_ACK_EN,
|
||||
+ ISCSI_NET_PARAM_TCP_NAGLE_DISABLE,
|
||||
+ ISCSI_NET_PARAM_TCP_WSF_DISABLE,
|
||||
+ ISCSI_NET_PARAM_TCP_WSF,
|
||||
+ ISCSI_NET_PARAM_TCP_TIMER_SCALE,
|
||||
+ ISCSI_NET_PARAM_TCP_TIMESTAMP_EN,
|
||||
+ ISCSI_NET_PARAM_CACHE_ID,
|
||||
+ ISCSI_NET_PARAM_IPV4_DHCP_DNS_ADDR_EN,
|
||||
+ ISCSI_NET_PARAM_IPV4_DHCP_SLP_DA_EN,
|
||||
+ ISCSI_NET_PARAM_IPV4_TOS_EN,
|
||||
+ ISCSI_NET_PARAM_IPV4_TOS,
|
||||
+ ISCSI_NET_PARAM_IPV4_GRAT_ARP_EN,
|
||||
+ ISCSI_NET_PARAM_IPV4_DHCP_ALT_CLIENT_ID_EN,
|
||||
+ ISCSI_NET_PARAM_IPV4_DHCP_ALT_CLIENT_ID,
|
||||
+ ISCSI_NET_PARAM_IPV4_DHCP_REQ_VENDOR_ID_EN,
|
||||
+ ISCSI_NET_PARAM_IPV4_DHCP_USE_VENDOR_ID_EN,
|
||||
+ ISCSI_NET_PARAM_IPV4_DHCP_VENDOR_ID,
|
||||
+ ISCSI_NET_PARAM_IPV4_DHCP_LEARN_IQN_EN,
|
||||
+ ISCSI_NET_PARAM_IPV4_FRAGMENT_DISABLE,
|
||||
+ ISCSI_NET_PARAM_IPV4_IN_FORWARD_EN,
|
||||
+ ISCSI_NET_PARAM_IPV4_TTL,
|
||||
+ ISCSI_NET_PARAM_IPV6_GRAT_NEIGHBOR_ADV_EN,
|
||||
+ ISCSI_NET_PARAM_IPV6_MLD_EN,
|
||||
+ ISCSI_NET_PARAM_IPV6_FLOW_LABEL,
|
||||
+ ISCSI_NET_PARAM_IPV6_TRAFFIC_CLASS,
|
||||
+ ISCSI_NET_PARAM_IPV6_HOP_LIMIT,
|
||||
+ ISCSI_NET_PARAM_IPV6_ND_REACHABLE_TMO,
|
||||
+ ISCSI_NET_PARAM_IPV6_ND_REXMIT_TIME,
|
||||
+ ISCSI_NET_PARAM_IPV6_ND_STALE_TMO,
|
||||
+ ISCSI_NET_PARAM_IPV6_DUP_ADDR_DETECT_CNT,
|
||||
+ ISCSI_NET_PARAM_IPV6_RTR_ADV_LINK_MTU,
|
||||
+ ISCSI_NET_PARAM_REDIRECT_EN,
|
||||
+};
|
||||
+
|
||||
+enum iscsi_ipaddress_state {
|
||||
+ ISCSI_IPDDRESS_STATE_UNCONFIGURED,
|
||||
+ ISCSI_IPDDRESS_STATE_ACQUIRING,
|
||||
+ ISCSI_IPDDRESS_STATE_TENTATIVE,
|
||||
+ ISCSI_IPDDRESS_STATE_VALID,
|
||||
+ ISCSI_IPDDRESS_STATE_DISABLING,
|
||||
+ ISCSI_IPDDRESS_STATE_INVALID,
|
||||
+ ISCSI_IPDDRESS_STATE_DEPRECATED,
|
||||
+};
|
||||
+
|
||||
+enum iscsi_router_state {
|
||||
+ ISCSI_ROUTER_STATE_UNKNOWN,
|
||||
+ ISCSI_ROUTER_STATE_ADVERTISED,
|
||||
+ ISCSI_ROUTER_STATE_MANUAL,
|
||||
+ ISCSI_ROUTER_STATE_STALE,
|
||||
+};
|
||||
+
|
||||
+/* iSCSI specific settings params for iface */
|
||||
+enum iscsi_iface_param {
|
||||
+ ISCSI_IFACE_PARAM_DEF_TASKMGMT_TMO,
|
||||
+ ISCSI_IFACE_PARAM_HDRDGST_EN,
|
||||
+ ISCSI_IFACE_PARAM_DATADGST_EN,
|
||||
+ ISCSI_IFACE_PARAM_IMM_DATA_EN,
|
||||
+ ISCSI_IFACE_PARAM_INITIAL_R2T_EN,
|
||||
+ ISCSI_IFACE_PARAM_DATASEQ_INORDER_EN,
|
||||
+ ISCSI_IFACE_PARAM_PDU_INORDER_EN,
|
||||
+ ISCSI_IFACE_PARAM_ERL,
|
||||
+ ISCSI_IFACE_PARAM_MAX_RECV_DLENGTH,
|
||||
+ ISCSI_IFACE_PARAM_FIRST_BURST,
|
||||
+ ISCSI_IFACE_PARAM_MAX_R2T,
|
||||
+ ISCSI_IFACE_PARAM_MAX_BURST,
|
||||
+ ISCSI_IFACE_PARAM_CHAP_AUTH_EN,
|
||||
+ ISCSI_IFACE_PARAM_BIDI_CHAP_EN,
|
||||
+ ISCSI_IFACE_PARAM_DISCOVERY_AUTH_OPTIONAL,
|
||||
+ ISCSI_IFACE_PARAM_DISCOVERY_LOGOUT_EN,
|
||||
+ ISCSI_IFACE_PARAM_STRICT_LOGIN_COMP_EN,
|
||||
+ ISCSI_IFACE_PARAM_INITIATOR_NAME,
|
||||
};
|
||||
|
||||
enum iscsi_conn_state {
|
||||
--
|
||||
1.8.3.1
|
||||
|
243
0045-iscsi-tools-Use-macro-to-set-IPv4-IPv6-IP-addresses.patch
Normal file
243
0045-iscsi-tools-Use-macro-to-set-IPv4-IPv6-IP-addresses.patch
Normal file
@ -0,0 +1,243 @@
|
||||
From 466efaad99b0fc0d1181443386b823739a8b483b Mon Sep 17 00:00:00 2001
|
||||
From: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
|
||||
Date: Fri, 18 Oct 2013 09:29:20 -0400
|
||||
Subject: [PATCH] iscsi tools: Use macro to set IPv4/IPv6 IP addresses
|
||||
|
||||
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
|
||||
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
|
||||
Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
|
||||
---
|
||||
usr/iface.c | 154 +++++++++++++++++++++++++++---------------------------------
|
||||
1 file changed, 69 insertions(+), 85 deletions(-)
|
||||
|
||||
diff --git a/usr/iface.c b/usr/iface.c
|
||||
index 8580d1a..19ad5ab 100644
|
||||
--- a/usr/iface.c
|
||||
+++ b/usr/iface.c
|
||||
@@ -1484,8 +1484,8 @@ static int iface_fill_router_autocfg(struct iovec *iov, struct iface_rec *iface)
|
||||
}
|
||||
|
||||
/* IPv4 IPAddress/Subnet Mask/Gateway: 4 bytes */
|
||||
-static int iface_fill_net_ipv4_addr(struct iovec *iov, struct iface_rec *iface,
|
||||
- uint32_t param)
|
||||
+static int iface_fill_net_ipv4_addr(struct iovec *iov, uint32_t iface_num,
|
||||
+ uint16_t param, char *param_val)
|
||||
{
|
||||
int rc = 1;
|
||||
int len;
|
||||
@@ -1502,29 +1502,12 @@ static int iface_fill_net_ipv4_addr(struct iovec *iov, struct iface_rec *iface,
|
||||
net_param = (struct iscsi_iface_param_info *)ISCSI_NLA_DATA(attr);
|
||||
net_param->param = param;
|
||||
net_param->iface_type = ISCSI_IFACE_TYPE_IPV4;
|
||||
- net_param->iface_num = iface->iface_num;
|
||||
+ net_param->iface_num = iface_num;
|
||||
net_param->len = 4;
|
||||
net_param->param_type = ISCSI_NET_PARAM;
|
||||
-
|
||||
- switch (param) {
|
||||
- case ISCSI_NET_PARAM_IPV4_ADDR:
|
||||
- rc = inet_pton(AF_INET, iface->ipaddress, net_param->value);
|
||||
- if (rc <= 0)
|
||||
- goto free;
|
||||
- break;
|
||||
- case ISCSI_NET_PARAM_IPV4_SUBNET:
|
||||
- rc = inet_pton(AF_INET, iface->subnet_mask, net_param->value);
|
||||
- if (rc <= 0)
|
||||
- goto free;
|
||||
- break;
|
||||
- case ISCSI_NET_PARAM_IPV4_GW:
|
||||
- rc = inet_pton(AF_INET, iface->gateway, net_param->value);
|
||||
- if (rc <= 0)
|
||||
- goto free;
|
||||
- break;
|
||||
- default:
|
||||
+ rc = inet_pton(AF_INET, param_val, net_param->value);
|
||||
+ if (rc <= 0)
|
||||
goto free;
|
||||
- }
|
||||
|
||||
/* validate */
|
||||
if (!net_param->value[0] && !net_param->value[1] &&
|
||||
@@ -1539,9 +1522,19 @@ free:
|
||||
return 1;
|
||||
}
|
||||
|
||||
+#define IFACE_SET_NET_PARAM_IPV4_ADDR(iov, inum, param, ival, gcnt, \
|
||||
+ lcnt) { \
|
||||
+ if (strstr(ival, ".")) { \
|
||||
+ if (!iface_fill_net_ipv4_addr(iov, inum, param, ival)) {\
|
||||
+ (*gcnt)++; \
|
||||
+ (*lcnt)++; \
|
||||
+ } \
|
||||
+ } \
|
||||
+}
|
||||
+
|
||||
/* IPv6 IPAddress/LinkLocal/Router: 16 bytes */
|
||||
-static int iface_fill_net_ipv6_addr(struct iovec *iov, struct iface_rec *iface,
|
||||
- uint32_t param)
|
||||
+static int iface_fill_net_ipv6_addr(struct iovec *iov, uint32_t iface_num,
|
||||
+ uint16_t param, char *param_val)
|
||||
{
|
||||
int rc;
|
||||
int len;
|
||||
@@ -1558,30 +1551,12 @@ static int iface_fill_net_ipv6_addr(struct iovec *iov, struct iface_rec *iface,
|
||||
net_param = (struct iscsi_iface_param_info *)ISCSI_NLA_DATA(attr);
|
||||
net_param->param = param;
|
||||
net_param->iface_type = ISCSI_IFACE_TYPE_IPV6;
|
||||
- net_param->iface_num = iface->iface_num;
|
||||
+ net_param->iface_num = iface_num;
|
||||
net_param->param_type = ISCSI_NET_PARAM;
|
||||
net_param->len = 16;
|
||||
-
|
||||
- switch (param) {
|
||||
- case ISCSI_NET_PARAM_IPV6_ADDR:
|
||||
- rc = inet_pton(AF_INET6, iface->ipaddress, net_param->value);
|
||||
- if (rc <= 0)
|
||||
- goto free;
|
||||
- break;
|
||||
- case ISCSI_NET_PARAM_IPV6_LINKLOCAL:
|
||||
- rc = inet_pton(AF_INET6, iface->ipv6_linklocal,
|
||||
- net_param->value);
|
||||
- if (rc <= 0)
|
||||
- goto free;
|
||||
- break;
|
||||
- case ISCSI_NET_PARAM_IPV6_ROUTER:
|
||||
- rc = inet_pton(AF_INET6, iface->ipv6_router, net_param->value);
|
||||
- if (rc <= 0)
|
||||
- goto free;
|
||||
- break;
|
||||
- default:
|
||||
+ rc = inet_pton(AF_INET6, param_val, net_param->value);
|
||||
+ if (rc <= 0)
|
||||
goto free;
|
||||
- }
|
||||
|
||||
return 0;
|
||||
free:
|
||||
@@ -1591,6 +1566,16 @@ free:
|
||||
return 1;
|
||||
}
|
||||
|
||||
+#define IFACE_SET_NET_PARAM_IPV6_ADDR(iov, inum, param, ival, gcnt, \
|
||||
+ lcnt) { \
|
||||
+ if (strstr(ival, ":")) { \
|
||||
+ if (!iface_fill_net_ipv6_addr(iov, inum, param, ival)) {\
|
||||
+ (*gcnt)++; \
|
||||
+ (*lcnt)++; \
|
||||
+ } \
|
||||
+ } \
|
||||
+}
|
||||
+
|
||||
struct iface_net_config {
|
||||
struct iface_rec *primary;
|
||||
struct iovec *iovs;
|
||||
@@ -1635,28 +1620,27 @@ static int __iface_build_net_config(void *data, struct iface_rec *iface)
|
||||
net_config->count++;
|
||||
count++;
|
||||
}
|
||||
- if (!iface_fill_net_ipv4_addr(&iov[net_config->count],
|
||||
- iface,
|
||||
- ISCSI_NET_PARAM_IPV4_ADDR)) {
|
||||
- net_config->count++;
|
||||
- count++;
|
||||
- }
|
||||
- if (strstr(iface->subnet_mask, ".")) {
|
||||
- if (!iface_fill_net_ipv4_addr(
|
||||
- &iov[net_config->count], iface,
|
||||
- ISCSI_NET_PARAM_IPV4_SUBNET)) {
|
||||
- net_config->count++;
|
||||
- count++;
|
||||
- }
|
||||
- }
|
||||
- if (strstr(iface->gateway, ".")) {
|
||||
- if (!iface_fill_net_ipv4_addr(
|
||||
- &iov[net_config->count], iface,
|
||||
- ISCSI_NET_PARAM_IPV4_GW)) {
|
||||
- net_config->count++;
|
||||
- count++;
|
||||
- }
|
||||
- }
|
||||
+
|
||||
+ IFACE_SET_NET_PARAM_IPV4_ADDR(&iov[net_config->count],
|
||||
+ iface->iface_num,
|
||||
+ ISCSI_NET_PARAM_IPV4_ADDR,
|
||||
+ iface->ipaddress,
|
||||
+ &net_config->count,
|
||||
+ &count);
|
||||
+
|
||||
+ IFACE_SET_NET_PARAM_IPV4_ADDR(&iov[net_config->count],
|
||||
+ iface->iface_num,
|
||||
+ ISCSI_NET_PARAM_IPV4_SUBNET,
|
||||
+ iface->subnet_mask,
|
||||
+ &net_config->count,
|
||||
+ &count);
|
||||
+
|
||||
+ IFACE_SET_NET_PARAM_IPV4_ADDR(&iov[net_config->count],
|
||||
+ iface->iface_num,
|
||||
+ ISCSI_NET_PARAM_IPV4_GW,
|
||||
+ iface->gateway,
|
||||
+ &net_config->count,
|
||||
+ &count);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1727,12 +1711,12 @@ static int __iface_build_net_config(void *data, struct iface_rec *iface)
|
||||
count++;
|
||||
}
|
||||
/* User provided IPv6 Address */
|
||||
- if (!iface_fill_net_ipv6_addr(&iov[net_config->count],
|
||||
- iface,
|
||||
- ISCSI_NET_PARAM_IPV6_ADDR)) {
|
||||
- net_config->count++;
|
||||
- count++;
|
||||
- }
|
||||
+ IFACE_SET_NET_PARAM_IPV6_ADDR(&iov[net_config->count],
|
||||
+ iface->iface_num,
|
||||
+ ISCSI_NET_PARAM_IPV6_ADDR,
|
||||
+ iface->ipaddress,
|
||||
+ &net_config->count,
|
||||
+ &count);
|
||||
}
|
||||
|
||||
/* For LinkLocal Address */
|
||||
@@ -1751,12 +1735,12 @@ static int __iface_build_net_config(void *data, struct iface_rec *iface)
|
||||
count++;
|
||||
}
|
||||
/* User provided Link Local Address */
|
||||
- if (!iface_fill_net_ipv6_addr(&iov[net_config->count],
|
||||
- iface,
|
||||
- ISCSI_NET_PARAM_IPV6_LINKLOCAL)) {
|
||||
- net_config->count++;
|
||||
- count++;
|
||||
- }
|
||||
+ IFACE_SET_NET_PARAM_IPV6_ADDR(&iov[net_config->count],
|
||||
+ iface->iface_num,
|
||||
+ ISCSI_NET_PARAM_IPV6_LINKLOCAL,
|
||||
+ iface->ipv6_linklocal,
|
||||
+ &net_config->count,
|
||||
+ &count);
|
||||
}
|
||||
|
||||
/* For Router Address */
|
||||
@@ -1773,12 +1757,12 @@ static int __iface_build_net_config(void *data, struct iface_rec *iface)
|
||||
count++;
|
||||
}
|
||||
/* User provided Router Address */
|
||||
- if (!iface_fill_net_ipv6_addr(&iov[net_config->count],
|
||||
- iface,
|
||||
- ISCSI_NET_PARAM_IPV6_ROUTER)) {
|
||||
- net_config->count++;
|
||||
- count++;
|
||||
- }
|
||||
+ IFACE_SET_NET_PARAM_IPV6_ADDR(&iov[net_config->count],
|
||||
+ iface->iface_num,
|
||||
+ ISCSI_NET_PARAM_IPV6_ROUTER,
|
||||
+ iface->ipv6_router,
|
||||
+ &net_config->count,
|
||||
+ &count);
|
||||
}
|
||||
|
||||
/*
|
||||
--
|
||||
1.8.3.1
|
||||
|
220
0046-iscsi-tools-Use-single-function-to-enable-disable-ne.patch
Normal file
220
0046-iscsi-tools-Use-single-function-to-enable-disable-ne.patch
Normal file
@ -0,0 +1,220 @@
|
||||
From 2220ee4334637946e93dca5c68889b5e3e807515 Mon Sep 17 00:00:00 2001
|
||||
From: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
|
||||
Date: Fri, 18 Oct 2013 09:29:21 -0400
|
||||
Subject: [PATCH] iscsi tools: Use single function to enable/disable network
|
||||
parameters
|
||||
|
||||
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
|
||||
Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
|
||||
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
|
||||
---
|
||||
usr/iface.c | 148 ++++++++++++++++++++++++++++++------------------------------
|
||||
1 file changed, 74 insertions(+), 74 deletions(-)
|
||||
|
||||
diff --git a/usr/iface.c b/usr/iface.c
|
||||
index 19ad5ab..292c804 100644
|
||||
--- a/usr/iface.c
|
||||
+++ b/usr/iface.c
|
||||
@@ -1311,60 +1311,45 @@ static int iface_fill_vlan_id(struct iovec *iov, struct iface_rec *iface,
|
||||
return 0;
|
||||
}
|
||||
|
||||
-/* IPv4/IPv6 VLAN state: disable/enable */
|
||||
-static int iface_fill_vlan_state(struct iovec *iov, struct iface_rec *iface,
|
||||
- uint32_t iface_type)
|
||||
+/* disable/enable parameters */
|
||||
+static int iface_fill_param_state(struct iovec *iov, uint32_t iface_num,
|
||||
+ uint8_t iface_type, uint16_t param,
|
||||
+ uint8_t param_type, char *param_val)
|
||||
{
|
||||
int len;
|
||||
struct iscsi_iface_param_info *net_param;
|
||||
struct nlattr *attr;
|
||||
|
||||
+ if (!param_val[0])
|
||||
+ return 1;
|
||||
+
|
||||
len = sizeof(struct iscsi_iface_param_info) + 1;
|
||||
- iov->iov_base = iscsi_nla_alloc(ISCSI_NET_PARAM_VLAN_ENABLED, len);
|
||||
+ iov->iov_base = iscsi_nla_alloc(param, 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_ENABLED;
|
||||
- net_param->iface_type = iface_type;
|
||||
- net_param->iface_num = iface->iface_num;
|
||||
- net_param->param_type = ISCSI_NET_PARAM;
|
||||
+ net_param->iface_num = iface_num;
|
||||
net_param->len = 1;
|
||||
- if (strcmp(iface->vlan_state, "disable") && iface->vlan_id)
|
||||
- net_param->value[0] = ISCSI_VLAN_ENABLE;
|
||||
+ net_param->param = param;
|
||||
+ net_param->iface_type = iface_type;
|
||||
+ net_param->param_type = param_type;
|
||||
+ if (strcmp(param_val, "disable"))
|
||||
+ net_param->value[0] = ISCSI_NET_PARAM_ENABLE;
|
||||
else /* Assume disabled */
|
||||
- net_param->value[0] = ISCSI_VLAN_DISABLE;
|
||||
+ net_param->value[0] = ISCSI_NET_PARAM_DISABLE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
-/* IPv4/IPv6 Network state: disable/enable */
|
||||
-static int iface_fill_net_state(struct iovec *iov, struct iface_rec *iface,
|
||||
- uint32_t iface_type)
|
||||
-{
|
||||
- int len;
|
||||
- struct iscsi_iface_param_info *net_param;
|
||||
- struct nlattr *attr;
|
||||
-
|
||||
- len = sizeof(struct iscsi_iface_param_info) + 1;
|
||||
- iov->iov_base = iscsi_nla_alloc(ISCSI_NET_PARAM_IFACE_ENABLE, 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_IFACE_ENABLE;
|
||||
- net_param->iface_type = iface_type;
|
||||
- net_param->iface_num = iface->iface_num;
|
||||
- net_param->param_type = ISCSI_NET_PARAM;
|
||||
- net_param->len = 1;
|
||||
- if (!strcmp(iface->state, "disable"))
|
||||
- net_param->value[0] = ISCSI_IFACE_DISABLE;
|
||||
- else /* Assume enabled */
|
||||
- net_param->value[0] = ISCSI_IFACE_ENABLE;
|
||||
- return 0;
|
||||
+#define IFACE_SET_PARAM_STATE(iov, inum, itype, param, ptype, ival, \
|
||||
+ gcnt, lcnt) { \
|
||||
+ if (!iface_fill_param_state(iov, inum, itype, param, ptype, \
|
||||
+ ival)) { \
|
||||
+ (*gcnt)++; \
|
||||
+ (*lcnt)++; \
|
||||
+ } \
|
||||
}
|
||||
|
||||
/* IPv4 Bootproto: DHCP/static */
|
||||
@@ -1598,13 +1583,14 @@ static int __iface_build_net_config(void *data, struct iface_rec *iface)
|
||||
iptype = iface_get_iptype(iface);
|
||||
if (iptype == ISCSI_IFACE_TYPE_IPV4) {
|
||||
if (!strcmp(iface->state, "disable")) {
|
||||
- if (!iface_fill_net_state(&iov[net_config->count],
|
||||
- iface,
|
||||
- ISCSI_IFACE_TYPE_IPV4)) {
|
||||
- net_config->count++;
|
||||
- count++;
|
||||
- }
|
||||
-
|
||||
+ IFACE_SET_PARAM_STATE(&iov[net_config->count],
|
||||
+ iface->iface_num,
|
||||
+ ISCSI_IFACE_TYPE_IPV4,
|
||||
+ ISCSI_NET_PARAM_IFACE_ENABLE,
|
||||
+ ISCSI_NET_PARAM,
|
||||
+ iface->state,
|
||||
+ &net_config->count,
|
||||
+ &count);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1648,18 +1634,24 @@ static int __iface_build_net_config(void *data, struct iface_rec *iface)
|
||||
* fill state and other parameters (if any)
|
||||
*/
|
||||
if (count) {
|
||||
- if (!iface_fill_net_state(&iov[net_config->count],
|
||||
- iface,
|
||||
- ISCSI_IFACE_TYPE_IPV4)) {
|
||||
- net_config->count++;
|
||||
- count++;
|
||||
- }
|
||||
- if (!iface_fill_vlan_state(&iov[net_config->count],
|
||||
- iface,
|
||||
- ISCSI_IFACE_TYPE_IPV4)) {
|
||||
- net_config->count++;
|
||||
- count++;
|
||||
- }
|
||||
+ IFACE_SET_PARAM_STATE(&iov[net_config->count],
|
||||
+ iface->iface_num,
|
||||
+ ISCSI_IFACE_TYPE_IPV4,
|
||||
+ ISCSI_NET_PARAM_IFACE_ENABLE,
|
||||
+ ISCSI_NET_PARAM,
|
||||
+ iface->state,
|
||||
+ &net_config->count,
|
||||
+ &count);
|
||||
+
|
||||
+ IFACE_SET_PARAM_STATE(&iov[net_config->count],
|
||||
+ iface->iface_num,
|
||||
+ ISCSI_IFACE_TYPE_IPV4,
|
||||
+ ISCSI_NET_PARAM_VLAN_ENABLED,
|
||||
+ ISCSI_NET_PARAM,
|
||||
+ iface->vlan_state,
|
||||
+ &net_config->count,
|
||||
+ &count);
|
||||
+
|
||||
if (strcmp(iface->vlan_state, "disable") &&
|
||||
iface->vlan_id) {
|
||||
if (!iface_fill_vlan_id(&iov[net_config->count],
|
||||
@@ -1687,12 +1679,14 @@ static int __iface_build_net_config(void *data, struct iface_rec *iface)
|
||||
}
|
||||
} else if (iptype == ISCSI_IFACE_TYPE_IPV6) {
|
||||
if (!strcmp(iface->state, "disable")) {
|
||||
- if (!iface_fill_net_state(&iov[net_config->count],
|
||||
- iface,
|
||||
- ISCSI_IFACE_TYPE_IPV6)) {
|
||||
- net_config->count++;
|
||||
- count++;
|
||||
- }
|
||||
+ IFACE_SET_PARAM_STATE(&iov[net_config->count],
|
||||
+ iface->iface_num,
|
||||
+ ISCSI_IFACE_TYPE_IPV6,
|
||||
+ ISCSI_NET_PARAM_IFACE_ENABLE,
|
||||
+ ISCSI_NET_PARAM,
|
||||
+ iface->state,
|
||||
+ &net_config->count,
|
||||
+ &count);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1770,18 +1764,24 @@ static int __iface_build_net_config(void *data, struct iface_rec *iface)
|
||||
* fill state and other parameters
|
||||
*/
|
||||
if (count) {
|
||||
- if (!iface_fill_net_state(&iov[net_config->count],
|
||||
- iface,
|
||||
- ISCSI_IFACE_TYPE_IPV6)) {
|
||||
- net_config->count++;
|
||||
- count++;
|
||||
- }
|
||||
- if (!iface_fill_vlan_state(&iov[net_config->count],
|
||||
- iface,
|
||||
- ISCSI_IFACE_TYPE_IPV6)) {
|
||||
- net_config->count++;
|
||||
- count++;
|
||||
- }
|
||||
+ IFACE_SET_PARAM_STATE(&iov[net_config->count],
|
||||
+ iface->iface_num,
|
||||
+ ISCSI_IFACE_TYPE_IPV6,
|
||||
+ ISCSI_NET_PARAM_IFACE_ENABLE,
|
||||
+ ISCSI_NET_PARAM,
|
||||
+ iface->state,
|
||||
+ &net_config->count,
|
||||
+ &count);
|
||||
+
|
||||
+ IFACE_SET_PARAM_STATE(&iov[net_config->count],
|
||||
+ iface->iface_num,
|
||||
+ ISCSI_IFACE_TYPE_IPV6,
|
||||
+ ISCSI_NET_PARAM_VLAN_ENABLED,
|
||||
+ ISCSI_NET_PARAM,
|
||||
+ iface->vlan_state,
|
||||
+ &net_config->count,
|
||||
+ &count);
|
||||
+
|
||||
if (strcmp(iface->vlan_state, "disable") &&
|
||||
iface->vlan_id) {
|
||||
if (!iface_fill_vlan_id(&iov[net_config->count],
|
||||
--
|
||||
1.8.3.1
|
||||
|
215
0047-iscsi-tools-Use-single-function-to-set-integer-netwo.patch
Normal file
215
0047-iscsi-tools-Use-single-function-to-set-integer-netwo.patch
Normal file
@ -0,0 +1,215 @@
|
||||
From d8991c9e1de373a1c55ad2f8ca07bb3fbda1aa5c Mon Sep 17 00:00:00 2001
|
||||
From: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
|
||||
Date: Fri, 18 Oct 2013 09:29:22 -0400
|
||||
Subject: [PATCH] iscsi tools: Use single function to set integer network
|
||||
parameters
|
||||
|
||||
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
|
||||
Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
|
||||
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
|
||||
---
|
||||
usr/iface.c | 162 +++++++++++++++++++++++++++++++++---------------------------
|
||||
1 file changed, 90 insertions(+), 72 deletions(-)
|
||||
|
||||
diff --git a/usr/iface.c b/usr/iface.c
|
||||
index 292c804..6454f75 100644
|
||||
--- a/usr/iface.c
|
||||
+++ b/usr/iface.c
|
||||
@@ -1223,58 +1223,68 @@ int iface_get_param_count(struct iface_rec *iface, int iface_all)
|
||||
return iface_params.count;
|
||||
}
|
||||
|
||||
-/* IPv4/IPv6 Port: 3260 or User defined */
|
||||
-static int iface_fill_port(struct iovec *iov, struct iface_rec *iface,
|
||||
- uint32_t iface_type)
|
||||
+/* write integer parameter value */
|
||||
+static int iface_fill_int_param_val(struct iovec *iov, uint32_t iface_num,
|
||||
+ uint8_t iface_type, uint16_t param,
|
||||
+ uint8_t param_type, uint32_t param_len,
|
||||
+ uint32_t param_val)
|
||||
{
|
||||
int len;
|
||||
struct iscsi_iface_param_info *net_param;
|
||||
- uint16_t port = 3260;
|
||||
struct nlattr *attr;
|
||||
+ uint8_t val8 = 0;
|
||||
+ uint16_t val16 = 0;
|
||||
+ uint32_t val32 = 0;
|
||||
+ char *val = NULL;
|
||||
|
||||
- len = sizeof(struct iscsi_iface_param_info) + sizeof(port);
|
||||
- iov->iov_base = iscsi_nla_alloc(ISCSI_NET_PARAM_PORT, 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_PORT;
|
||||
- net_param->iface_type = iface_type;
|
||||
- net_param->iface_num = iface->iface_num;
|
||||
- net_param->param_type = ISCSI_NET_PARAM;
|
||||
- net_param->len = 2;
|
||||
- if (iface->port)
|
||||
- port = iface->port;
|
||||
- memcpy(net_param->value, &port, net_param->len);
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static int iface_fill_mtu(struct iovec *iov, struct iface_rec *iface,
|
||||
- uint32_t iface_type)
|
||||
-{
|
||||
- int len;
|
||||
- struct iscsi_iface_param_info *net_param;
|
||||
- uint16_t mtu = 0;
|
||||
- struct nlattr *attr;
|
||||
-
|
||||
- len = sizeof(struct iscsi_iface_param_info) + 2;
|
||||
- iov->iov_base = iscsi_nla_alloc(ISCSI_NET_PARAM_MTU, len);
|
||||
+ len = sizeof(struct iscsi_iface_param_info) + param_len;
|
||||
+ iov->iov_base = iscsi_nla_alloc(param, 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_MTU;
|
||||
+ net_param->iface_num = iface_num;
|
||||
+ net_param->len = param_len;
|
||||
+ net_param->param = param;
|
||||
net_param->iface_type = iface_type;
|
||||
- net_param->iface_num = iface->iface_num;
|
||||
- net_param->param_type = ISCSI_NET_PARAM;
|
||||
- net_param->len = 2;
|
||||
- mtu = iface->mtu;
|
||||
- memcpy(net_param->value, &mtu, net_param->len);
|
||||
+ net_param->param_type = param_type;
|
||||
+ switch (param_len) {
|
||||
+ case 1:
|
||||
+ val8 = (uint8_t)param_val;
|
||||
+ val = (char *)&val8;
|
||||
+ break;
|
||||
+
|
||||
+ case 2:
|
||||
+ val16 = (uint16_t)param_val;
|
||||
+ val = (char *)&val16;
|
||||
+ break;
|
||||
+
|
||||
+ case 4:
|
||||
+ val32 = (uint32_t)param_val;
|
||||
+ val = (char *)&val32;
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ goto free;
|
||||
+ }
|
||||
+ memcpy(net_param->value, val, param_len);
|
||||
return 0;
|
||||
+free:
|
||||
+ free(iov->iov_base);
|
||||
+ iov->iov_base = NULL;
|
||||
+ iov->iov_len = 0;
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+#define IFACE_SET_PARAM_INTVAL(iov, inum, itype, param, ptype, plen, \
|
||||
+ ival, gcnt, lcnt) { \
|
||||
+ if (ival && !iface_fill_int_param_val(iov, inum, itype, param, \
|
||||
+ ptype, plen, ival)) { \
|
||||
+ (*gcnt)++; \
|
||||
+ (*lcnt)++; \
|
||||
+ } \
|
||||
}
|
||||
|
||||
/* IPv4/IPv6 VLAN_ID: decimal value <= 4095 */
|
||||
@@ -1660,22 +1670,26 @@ static int __iface_build_net_config(void *data, struct iface_rec *iface)
|
||||
count++;
|
||||
}
|
||||
}
|
||||
- if (iface->mtu) {
|
||||
- if (!iface_fill_mtu(&iov[net_config->count],
|
||||
- iface,
|
||||
- ISCSI_IFACE_TYPE_IPV4)) {
|
||||
- net_config->count++;
|
||||
- count++;
|
||||
- }
|
||||
- }
|
||||
- if (iface->port) {
|
||||
- if (!iface_fill_port(&iov[net_config->count],
|
||||
- iface,
|
||||
- ISCSI_IFACE_TYPE_IPV4)) {
|
||||
- net_config->count++;
|
||||
- count++;
|
||||
- }
|
||||
- }
|
||||
+
|
||||
+ IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
|
||||
+ iface->iface_num,
|
||||
+ ISCSI_IFACE_TYPE_IPV4,
|
||||
+ ISCSI_NET_PARAM_MTU,
|
||||
+ ISCSI_NET_PARAM,
|
||||
+ 2,
|
||||
+ iface->mtu,
|
||||
+ &net_config->count,
|
||||
+ &count);
|
||||
+
|
||||
+ IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
|
||||
+ iface->iface_num,
|
||||
+ ISCSI_IFACE_TYPE_IPV4,
|
||||
+ ISCSI_NET_PARAM_PORT,
|
||||
+ ISCSI_NET_PARAM,
|
||||
+ 2,
|
||||
+ iface->port,
|
||||
+ &net_config->count,
|
||||
+ &count);
|
||||
}
|
||||
} else if (iptype == ISCSI_IFACE_TYPE_IPV6) {
|
||||
if (!strcmp(iface->state, "disable")) {
|
||||
@@ -1791,22 +1805,26 @@ static int __iface_build_net_config(void *data, struct iface_rec *iface)
|
||||
count++;
|
||||
}
|
||||
}
|
||||
- if (iface->mtu) {
|
||||
- if (!iface_fill_mtu(&iov[net_config->count],
|
||||
- iface,
|
||||
- ISCSI_IFACE_TYPE_IPV6)) {
|
||||
- net_config->count++;
|
||||
- count++;
|
||||
- }
|
||||
- }
|
||||
- if (iface->port) {
|
||||
- if (!iface_fill_port(&iov[net_config->count],
|
||||
- iface,
|
||||
- ISCSI_IFACE_TYPE_IPV6)) {
|
||||
- net_config->count++;
|
||||
- count++;
|
||||
- }
|
||||
- }
|
||||
+
|
||||
+ IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
|
||||
+ iface->iface_num,
|
||||
+ ISCSI_IFACE_TYPE_IPV6,
|
||||
+ ISCSI_NET_PARAM_MTU,
|
||||
+ ISCSI_NET_PARAM,
|
||||
+ 2,
|
||||
+ iface->mtu,
|
||||
+ &net_config->count,
|
||||
+ &count);
|
||||
+
|
||||
+ IFACE_SET_PARAM_INTVAL(&iov[net_config->count],
|
||||
+ iface->iface_num,
|
||||
+ ISCSI_IFACE_TYPE_IPV6,
|
||||
+ ISCSI_NET_PARAM_PORT,
|
||||
+ ISCSI_NET_PARAM,
|
||||
+ 2,
|
||||
+ iface->port,
|
||||
+ &net_config->count,
|
||||
+ &count);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,44 @@
|
||||
From da404f2137daa4e5cf06d69e4d7b6a0bff8c13b5 Mon Sep 17 00:00:00 2001
|
||||
From: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
|
||||
Date: Fri, 18 Oct 2013 09:29:23 -0400
|
||||
Subject: [PATCH] iscsi tools: Ignore network parameter if not enabled/disabled
|
||||
|
||||
If iface does not contain network parameter or incorrect value is set,
|
||||
do not send that network parameter value to driver.
|
||||
|
||||
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
|
||||
Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
|
||||
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
|
||||
---
|
||||
usr/iface.c | 13 ++++++++++---
|
||||
1 file changed, 10 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/usr/iface.c b/usr/iface.c
|
||||
index 6454f75..55b0dd4 100644
|
||||
--- a/usr/iface.c
|
||||
+++ b/usr/iface.c
|
||||
@@ -1346,11 +1346,18 @@ static int iface_fill_param_state(struct iovec *iov, uint32_t iface_num,
|
||||
net_param->param = param;
|
||||
net_param->iface_type = iface_type;
|
||||
net_param->param_type = param_type;
|
||||
- if (strcmp(param_val, "disable"))
|
||||
- net_param->value[0] = ISCSI_NET_PARAM_ENABLE;
|
||||
- else /* Assume disabled */
|
||||
+ if (!strcmp(param_val, "disable"))
|
||||
net_param->value[0] = ISCSI_NET_PARAM_DISABLE;
|
||||
+ else if (!strcmp(param_val, "enable"))
|
||||
+ net_param->value[0] = ISCSI_NET_PARAM_ENABLE;
|
||||
+ else
|
||||
+ goto free;
|
||||
return 0;
|
||||
+free:
|
||||
+ free(iov->iov_base);
|
||||
+ iov->iov_base = NULL;
|
||||
+ iov->iov_len = 0;
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
#define IFACE_SET_PARAM_STATE(iov, inum, itype, param, ptype, ival, \
|
||||
--
|
||||
1.8.3.1
|
||||
|
1445
0049-iscsi-tools-Additional-parameters-for-network-settin.patch
Normal file
1445
0049-iscsi-tools-Additional-parameters-for-network-settin.patch
Normal file
File diff suppressed because it is too large
Load Diff
119
0050-iscsi-tools-iface-params-should-be-updated-for-node_.patch
Normal file
119
0050-iscsi-tools-iface-params-should-be-updated-for-node_.patch
Normal file
@ -0,0 +1,119 @@
|
||||
From 9260457c1df5f519a63744114cbdf7e50cd75ed7 Mon Sep 17 00:00:00 2001
|
||||
From: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
|
||||
Date: Fri, 18 Oct 2013 09:29:25 -0400
|
||||
Subject: [PATCH] iscsi tools: iface params should be updated for node_rec as
|
||||
well.
|
||||
|
||||
While updating iface params, the changes should get applied to the
|
||||
node records as well.
|
||||
|
||||
Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
|
||||
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
|
||||
---
|
||||
usr/idbm.c | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 90 insertions(+)
|
||||
|
||||
diff --git a/usr/idbm.c b/usr/idbm.c
|
||||
index 4428ebe..c6460ad 100644
|
||||
--- a/usr/idbm.c
|
||||
+++ b/usr/idbm.c
|
||||
@@ -292,6 +292,96 @@ idbm_recinfo_node(node_rec_t *r, recinfo_t *ri)
|
||||
__recinfo_uint16(IFACE_MTU, ri, r, iface.mtu, IDBM_SHOW, num, 1);
|
||||
__recinfo_uint16(IFACE_PORT, ri, r, iface.port, IDBM_SHOW, num, 1);
|
||||
|
||||
+ __recinfo_str(IFACE_DHCP_ALT_CID, ri, r, iface.dhcp_alt_client_id_state,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_DHCP_ALT_CID_STR, ri, r, iface.dhcp_alt_client_id,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_DHCP_DNS, ri, r, iface.dhcp_dns, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_DHCP_LEARN_IQN, ri, r, iface.dhcp_learn_iqn,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_DHCP_REQ_VID, ri, r, iface.dhcp_req_vendor_id_state,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_DHCP_VID, ri, r, iface.dhcp_vendor_id_state,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_DHCP_VID_STR, ri, r, iface.dhcp_vendor_id,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_DHCP_SLP_DA, ri, r, iface.dhcp_slp_da, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_str(IFACE_FRAGMENTATION, ri, r, iface.fragmentation,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_GRAT_ARP, ri, r, iface.gratuitous_arp, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_str(IFACE_IN_FORWARD, ri, r, iface.incoming_forwarding,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_TOS_STATE, ri, r, iface.tos_state, IDBM_SHOW, num,
|
||||
+ 1);
|
||||
+ __recinfo_uint8(IFACE_TOS, ri, r, iface.tos, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint8(IFACE_TTL, ri, r, iface.ttl, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint8(IFACE_DUP_ADDR_DETECT_CNT, ri, r,
|
||||
+ iface.dup_addr_detect_cnt, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint32(IFACE_FLOW_LABEL, ri, r, iface.flow_label, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_str(IFACE_GRAT_NEIGHBOR_ADV, ri, r,
|
||||
+ iface.gratuitous_neighbor_adv, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint8(IFACE_HOP_LIMIT, ri, r, iface.hop_limit, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_str(IFACE_MLD, ri, r, iface.mld, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint32(IFACE_ND_REACHABLE_TMO, ri, r, iface.nd_reachable_tmo,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint32(IFACE_ND_REXMIT_TIME, ri, r, iface.nd_rexmit_time,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint32(IFACE_ND_STALE_TMO, ri, r, iface.nd_stale_tmo,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint32(IFACE_RTR_ADV_LINK_MTU, ri, r,
|
||||
+ iface.router_adv_link_mtu, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint8(IFACE_TRAFFIC_CLASS, ri, r, iface.traffic_class,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_DELAYED_ACK, ri, r, iface.delayed_ack, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_str(IFACE_TCP_NAGLE, ri, r, iface.nagle, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_TCP_WSF_STATE, ri, r, iface.tcp_wsf_state,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint8(IFACE_TCP_WSF, ri, r, iface.tcp_wsf, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint8(IFACE_TCP_TIMER_SCALE, ri, r, iface.tcp_timer_scale,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_TCP_TIMESTAMP, ri, r, iface.tcp_timestamp,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_REDIRECT, ri, r, iface.redirect, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint16(IFACE_DEF_TMF_TMO, ri, r, iface.def_task_mgmt_tmo,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_HDRDGST, ri, r, iface.header_digest, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_str(IFACE_DATADGST, ri, r, iface.data_digest, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_str(IFACE_IMM_DATA, ri, r, iface.immediate_data, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_str(IFACE_INITIAL_R2T, ri, r, iface.initial_r2t, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_str(IFACE_DSEQ_INORDER, ri, r, iface.data_seq_inorder,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_DPDU_INORDER, ri, r, iface.data_pdu_inorder,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint8(IFACE_ERL, ri, r, iface.erl, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint32(IFACE_MAX_RECV_DLEN, ri, r, iface.max_recv_dlength,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint32(IFACE_FIRST_BURST, ri, r, iface.first_burst_len,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint16(IFACE_MAX_R2T, ri, r, iface.max_out_r2t, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_uint32(IFACE_MAX_BURST, ri, r, iface.max_burst_len, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_str(IFACE_CHAP_AUTH, ri, r, iface.chap_auth, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_str(IFACE_BIDI_CHAP, ri, r, iface.bidi_chap, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_str(IFACE_STRICT_LOGIN_COMP, ri, r, iface.strict_login_comp,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_DISCOVERY_AUTH, ri, r, iface.discovery_auth,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_DISCOVERY_LOGOUT, ri, r, iface.discovery_logout,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+
|
||||
+
|
||||
__recinfo_str(NODE_DISC_ADDR, ri, r, disc_address, IDBM_SHOW,
|
||||
num, 0);
|
||||
__recinfo_int(NODE_DISC_PORT, ri, r, disc_port, IDBM_SHOW,
|
||||
--
|
||||
1.8.3.1
|
||||
|
33
0051-iscsi-tools-Let-default-type-of-iface-be-ipv4.patch
Normal file
33
0051-iscsi-tools-Let-default-type-of-iface-be-ipv4.patch
Normal file
@ -0,0 +1,33 @@
|
||||
From 75ee9d0af6e200b34e84b1e7b37971213b2fd629 Mon Sep 17 00:00:00 2001
|
||||
From: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
|
||||
Date: Fri, 18 Oct 2013 09:29:26 -0400
|
||||
Subject: [PATCH] iscsi tools: Let default type of iface be ipv4
|
||||
|
||||
While using iface name to determine its type if the name does not
|
||||
contain iface type then assume it be to of type ipv4 by default.
|
||||
|
||||
Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
|
||||
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
|
||||
---
|
||||
usr/iface.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/usr/iface.c b/usr/iface.c
|
||||
index 87ac875..870dba0 100644
|
||||
--- a/usr/iface.c
|
||||
+++ b/usr/iface.c
|
||||
@@ -450,8 +450,10 @@ int iface_get_iptype(struct iface_rec *iface)
|
||||
/* try to figure out by name */
|
||||
if (strstr(iface->name, "ipv4"))
|
||||
return ISCSI_IFACE_TYPE_IPV4;
|
||||
- else
|
||||
+ else if (strstr(iface->name, "ipv6"))
|
||||
return ISCSI_IFACE_TYPE_IPV6;
|
||||
+ else /* assume ipv4 by default */
|
||||
+ return ISCSI_IFACE_TYPE_IPV4;
|
||||
} else {
|
||||
if (strcmp(iface->bootproto, "dhcp") &&
|
||||
!strstr(iface->ipaddress, "."))
|
||||
--
|
||||
1.8.3.1
|
||||
|
310
0052-iscsi-tools-Show-iface-params-based-on-iface-type.patch
Normal file
310
0052-iscsi-tools-Show-iface-params-based-on-iface-type.patch
Normal file
@ -0,0 +1,310 @@
|
||||
From 4a5e9e29d7516e34e35a15c7342afbc3a1c8c176 Mon Sep 17 00:00:00 2001
|
||||
From: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
|
||||
Date: Fri, 18 Oct 2013 09:29:27 -0400
|
||||
Subject: [PATCH] iscsi tools: Show iface params based on iface type
|
||||
|
||||
Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
|
||||
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
|
||||
---
|
||||
usr/idbm.c | 250 ++++++++++++++++++++++++++++++++++---------------------------
|
||||
1 file changed, 138 insertions(+), 112 deletions(-)
|
||||
|
||||
diff --git a/usr/idbm.c b/usr/idbm.c
|
||||
index c6460ad..1ade099 100644
|
||||
--- a/usr/idbm.c
|
||||
+++ b/usr/idbm.c
|
||||
@@ -237,6 +237,9 @@ void
|
||||
idbm_recinfo_node(node_rec_t *r, recinfo_t *ri)
|
||||
{
|
||||
int num = 0, i;
|
||||
+ int iface_type;
|
||||
+
|
||||
+ iface_type = iface_get_iptype(&r->iface);
|
||||
|
||||
__recinfo_str(NODE_NAME, ri, r, name, IDBM_SHOW, num, 0);
|
||||
__recinfo_int(NODE_TPGT, ri, r, tpgt, IDBM_SHOW, num, 0);
|
||||
@@ -266,21 +269,6 @@ idbm_recinfo_node(node_rec_t *r, recinfo_t *ri)
|
||||
__recinfo_str(IFACE_TRANSPORTNAME, ri, r, iface.transport_name,
|
||||
IDBM_SHOW, num, 1);
|
||||
__recinfo_str(IFACE_INAME, ri, r, iface.iname, IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_BOOT_PROTO, ri, r, iface.bootproto, IDBM_SHOW,
|
||||
- num, 1);
|
||||
- __recinfo_str(IFACE_SUBNET_MASK, ri, r, iface.subnet_mask,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_GATEWAY, ri, r, iface.gateway, IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_IPV6_AUTOCFG, ri, r, iface.ipv6_autocfg,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_LINKLOCAL_AUTOCFG, ri, r, iface.linklocal_autocfg,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_ROUTER_AUTOCFG, ri, r, iface.router_autocfg,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_LINKLOCAL, ri, r, iface.ipv6_linklocal,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_ROUTER, ri, r, iface.ipv6_router, IDBM_SHOW, num,
|
||||
- 1);
|
||||
__recinfo_str(IFACE_STATE, ri, r, iface.state, IDBM_SHOW, num, 1);
|
||||
__recinfo_uint16(IFACE_VLAN_ID, ri, r, iface.vlan_id, IDBM_SHOW, num,
|
||||
1);
|
||||
@@ -292,50 +280,73 @@ idbm_recinfo_node(node_rec_t *r, recinfo_t *ri)
|
||||
__recinfo_uint16(IFACE_MTU, ri, r, iface.mtu, IDBM_SHOW, num, 1);
|
||||
__recinfo_uint16(IFACE_PORT, ri, r, iface.port, IDBM_SHOW, num, 1);
|
||||
|
||||
- __recinfo_str(IFACE_DHCP_ALT_CID, ri, r, iface.dhcp_alt_client_id_state,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_DHCP_ALT_CID_STR, ri, r, iface.dhcp_alt_client_id,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_DHCP_DNS, ri, r, iface.dhcp_dns, IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_DHCP_LEARN_IQN, ri, r, iface.dhcp_learn_iqn,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_DHCP_REQ_VID, ri, r, iface.dhcp_req_vendor_id_state,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_DHCP_VID, ri, r, iface.dhcp_vendor_id_state,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_DHCP_VID_STR, ri, r, iface.dhcp_vendor_id,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_DHCP_SLP_DA, ri, r, iface.dhcp_slp_da, IDBM_SHOW,
|
||||
- num, 1);
|
||||
- __recinfo_str(IFACE_FRAGMENTATION, ri, r, iface.fragmentation,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_GRAT_ARP, ri, r, iface.gratuitous_arp, IDBM_SHOW,
|
||||
- num, 1);
|
||||
- __recinfo_str(IFACE_IN_FORWARD, ri, r, iface.incoming_forwarding,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_TOS_STATE, ri, r, iface.tos_state, IDBM_SHOW, num,
|
||||
- 1);
|
||||
- __recinfo_uint8(IFACE_TOS, ri, r, iface.tos, IDBM_SHOW, num, 1);
|
||||
- __recinfo_uint8(IFACE_TTL, ri, r, iface.ttl, IDBM_SHOW, num, 1);
|
||||
- __recinfo_uint8(IFACE_DUP_ADDR_DETECT_CNT, ri, r,
|
||||
- iface.dup_addr_detect_cnt, IDBM_SHOW, num, 1);
|
||||
- __recinfo_uint32(IFACE_FLOW_LABEL, ri, r, iface.flow_label, IDBM_SHOW,
|
||||
- num, 1);
|
||||
- __recinfo_str(IFACE_GRAT_NEIGHBOR_ADV, ri, r,
|
||||
- iface.gratuitous_neighbor_adv, IDBM_SHOW, num, 1);
|
||||
- __recinfo_uint8(IFACE_HOP_LIMIT, ri, r, iface.hop_limit, IDBM_SHOW,
|
||||
- num, 1);
|
||||
- __recinfo_str(IFACE_MLD, ri, r, iface.mld, IDBM_SHOW, num, 1);
|
||||
- __recinfo_uint32(IFACE_ND_REACHABLE_TMO, ri, r, iface.nd_reachable_tmo,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_uint32(IFACE_ND_REXMIT_TIME, ri, r, iface.nd_rexmit_time,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_uint32(IFACE_ND_STALE_TMO, ri, r, iface.nd_stale_tmo,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_uint32(IFACE_RTR_ADV_LINK_MTU, ri, r,
|
||||
- iface.router_adv_link_mtu, IDBM_SHOW, num, 1);
|
||||
- __recinfo_uint8(IFACE_TRAFFIC_CLASS, ri, r, iface.traffic_class,
|
||||
- IDBM_SHOW, num, 1);
|
||||
+ if (iface_type == ISCSI_IFACE_TYPE_IPV4) {
|
||||
+ __recinfo_str(IFACE_BOOT_PROTO, ri, r, iface.bootproto,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_SUBNET_MASK, ri, r, iface.subnet_mask,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_GATEWAY, ri, r, iface.gateway, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_str(IFACE_DHCP_ALT_CID, ri, r,
|
||||
+ iface.dhcp_alt_client_id_state, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_str(IFACE_DHCP_ALT_CID_STR, ri, r,
|
||||
+ iface.dhcp_alt_client_id, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_DHCP_DNS, ri, r, iface.dhcp_dns, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_str(IFACE_DHCP_LEARN_IQN, ri, r,
|
||||
+ iface.dhcp_learn_iqn, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_DHCP_REQ_VID, ri, r,
|
||||
+ iface.dhcp_req_vendor_id_state, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_str(IFACE_DHCP_VID, ri, r, iface.dhcp_vendor_id_state,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_DHCP_VID_STR, ri, r, iface.dhcp_vendor_id,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_DHCP_SLP_DA, ri, r, iface.dhcp_slp_da,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_FRAGMENTATION, ri, r, iface.fragmentation,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_GRAT_ARP, ri, r, iface.gratuitous_arp,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_IN_FORWARD, ri, r,
|
||||
+ iface.incoming_forwarding, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_TOS_STATE, ri, r, iface.tos_state,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint8(IFACE_TOS, ri, r, iface.tos, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint8(IFACE_TTL, ri, r, iface.ttl, IDBM_SHOW, num, 1);
|
||||
+ } else if (iface_type == ISCSI_IFACE_TYPE_IPV6) {
|
||||
+ __recinfo_str(IFACE_IPV6_AUTOCFG, ri, r, iface.ipv6_autocfg,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_LINKLOCAL_AUTOCFG, ri, r,
|
||||
+ iface.linklocal_autocfg, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_ROUTER_AUTOCFG, ri, r, iface.router_autocfg,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_LINKLOCAL, ri, r, iface.ipv6_linklocal,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_ROUTER, ri, r, iface.ipv6_router,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint8(IFACE_DUP_ADDR_DETECT_CNT, ri, r,
|
||||
+ iface.dup_addr_detect_cnt, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint32(IFACE_FLOW_LABEL, ri, r, iface.flow_label,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_GRAT_NEIGHBOR_ADV, ri, r,
|
||||
+ iface.gratuitous_neighbor_adv, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint8(IFACE_HOP_LIMIT, ri, r, iface.hop_limit,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_MLD, ri, r, iface.mld, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint32(IFACE_ND_REACHABLE_TMO, ri, r,
|
||||
+ iface.nd_reachable_tmo, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint32(IFACE_ND_REXMIT_TIME, ri, r,
|
||||
+ iface.nd_rexmit_time, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint32(IFACE_ND_STALE_TMO, ri, r, iface.nd_stale_tmo,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint32(IFACE_RTR_ADV_LINK_MTU, ri, r,
|
||||
+ iface.router_adv_link_mtu, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint8(IFACE_TRAFFIC_CLASS, ri, r, iface.traffic_class,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ }
|
||||
+
|
||||
__recinfo_str(IFACE_DELAYED_ACK, ri, r, iface.delayed_ack, IDBM_SHOW,
|
||||
num, 1);
|
||||
__recinfo_str(IFACE_TCP_NAGLE, ri, r, iface.nagle, IDBM_SHOW, num, 1);
|
||||
@@ -515,6 +526,9 @@ idbm_recinfo_node(node_rec_t *r, recinfo_t *ri)
|
||||
void idbm_recinfo_iface(iface_rec_t *r, recinfo_t *ri)
|
||||
{
|
||||
int num = 0;
|
||||
+ int iface_type;
|
||||
+
|
||||
+ iface_type = iface_get_iptype(r);
|
||||
|
||||
__recinfo_str(IFACE_ISCSINAME, ri, r, name, IDBM_SHOW, num, 0);
|
||||
__recinfo_str(IFACE_NETNAME, ri, r, netdev, IDBM_SHOW, num, 1);
|
||||
@@ -523,19 +537,6 @@ void idbm_recinfo_iface(iface_rec_t *r, recinfo_t *ri)
|
||||
__recinfo_str(IFACE_TRANSPORTNAME, ri, r, transport_name,
|
||||
IDBM_SHOW, num, 1);
|
||||
__recinfo_str(IFACE_INAME, ri, r, iname, IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_BOOT_PROTO, ri, r, bootproto, IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_SUBNET_MASK, ri, r, subnet_mask,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_GATEWAY, ri, r, gateway, IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_IPV6_AUTOCFG, ri, r, ipv6_autocfg,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_LINKLOCAL_AUTOCFG, ri, r, linklocal_autocfg,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_ROUTER_AUTOCFG, ri, r, router_autocfg,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_LINKLOCAL, ri, r, ipv6_linklocal,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_ROUTER, ri, r, ipv6_router, IDBM_SHOW, num, 1);
|
||||
__recinfo_str(IFACE_STATE, ri, r, state, IDBM_SHOW, num, 1);
|
||||
__recinfo_uint16(IFACE_VLAN_ID, ri, r, vlan_id, IDBM_SHOW, num, 1);
|
||||
__recinfo_uint8(IFACE_VLAN_PRIORITY, ri, r, vlan_priority,
|
||||
@@ -544,46 +545,71 @@ void idbm_recinfo_iface(iface_rec_t *r, recinfo_t *ri)
|
||||
__recinfo_int(IFACE_NUM, ri, r, iface_num, IDBM_SHOW, num, 1);
|
||||
__recinfo_uint16(IFACE_MTU, ri, r, mtu, IDBM_SHOW, num, 1);
|
||||
__recinfo_uint16(IFACE_PORT, ri, r, port, IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_DHCP_ALT_CID, ri, r, dhcp_alt_client_id_state,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_DHCP_ALT_CID_STR, ri, r, dhcp_alt_client_id,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_DHCP_DNS, ri, r, dhcp_dns, IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_DHCP_LEARN_IQN, ri, r, dhcp_learn_iqn, IDBM_SHOW,
|
||||
- num, 1);
|
||||
- __recinfo_str(IFACE_DHCP_REQ_VID, ri, r, dhcp_req_vendor_id_state,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_DHCP_VID, ri, r, dhcp_vendor_id_state, IDBM_SHOW,
|
||||
- num, 1);
|
||||
- __recinfo_str(IFACE_DHCP_VID_STR, ri, r, dhcp_vendor_id, IDBM_SHOW,
|
||||
- num, 1);
|
||||
- __recinfo_str(IFACE_DHCP_SLP_DA, ri, r, dhcp_slp_da, IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_FRAGMENTATION, ri, r, fragmentation, IDBM_SHOW,
|
||||
- num, 1);
|
||||
- __recinfo_str(IFACE_GRAT_ARP, ri, r, gratuitous_arp, IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_IN_FORWARD, ri, r, incoming_forwarding, IDBM_SHOW,
|
||||
- num, 1);
|
||||
- __recinfo_str(IFACE_TOS_STATE, ri, r, tos_state, IDBM_SHOW, num, 1);
|
||||
- __recinfo_uint8(IFACE_TOS, ri, r, tos, IDBM_SHOW, num, 1);
|
||||
- __recinfo_uint8(IFACE_TTL, ri, r, ttl, IDBM_SHOW, num, 1);
|
||||
- __recinfo_uint8(IFACE_DUP_ADDR_DETECT_CNT, ri, r, dup_addr_detect_cnt,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_uint32(IFACE_FLOW_LABEL, ri, r, flow_label, IDBM_SHOW,
|
||||
- num, 1);
|
||||
- __recinfo_str(IFACE_GRAT_NEIGHBOR_ADV, ri, r, gratuitous_neighbor_adv,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_uint8(IFACE_HOP_LIMIT, ri, r, hop_limit, IDBM_SHOW, num, 1);
|
||||
- __recinfo_str(IFACE_MLD, ri, r, mld, IDBM_SHOW, num, 1);
|
||||
- __recinfo_uint32(IFACE_ND_REACHABLE_TMO, ri, r, nd_reachable_tmo,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_uint32(IFACE_ND_REXMIT_TIME, ri, r, nd_rexmit_time, IDBM_SHOW,
|
||||
- num, 1);
|
||||
- __recinfo_uint32(IFACE_ND_STALE_TMO, ri, r, nd_stale_tmo, IDBM_SHOW,
|
||||
- num, 1);
|
||||
- __recinfo_uint32(IFACE_RTR_ADV_LINK_MTU, ri, r, router_adv_link_mtu,
|
||||
- IDBM_SHOW, num, 1);
|
||||
- __recinfo_uint8(IFACE_TRAFFIC_CLASS, ri, r, traffic_class, IDBM_SHOW,
|
||||
- num, 1);
|
||||
+
|
||||
+ if (iface_type == ISCSI_IFACE_TYPE_IPV4) {
|
||||
+ __recinfo_str(IFACE_BOOT_PROTO, ri, r, bootproto, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_str(IFACE_SUBNET_MASK, ri, r, subnet_mask, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_str(IFACE_GATEWAY, ri, r, gateway, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_DHCP_ALT_CID, ri, r,
|
||||
+ dhcp_alt_client_id_state, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_DHCP_ALT_CID_STR, ri, r, dhcp_alt_client_id,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_DHCP_DNS, ri, r, dhcp_dns, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_str(IFACE_DHCP_LEARN_IQN, ri, r, dhcp_learn_iqn,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_DHCP_REQ_VID, ri, r,
|
||||
+ dhcp_req_vendor_id_state, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_DHCP_VID, ri, r, dhcp_vendor_id_state,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_DHCP_VID_STR, ri, r, dhcp_vendor_id,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_DHCP_SLP_DA, ri, r, dhcp_slp_da, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_str(IFACE_FRAGMENTATION, ri, r, fragmentation,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_GRAT_ARP, ri, r, gratuitous_arp, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_str(IFACE_IN_FORWARD, ri, r, incoming_forwarding,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_TOS_STATE, ri, r, tos_state, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_uint8(IFACE_TOS, ri, r, tos, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint8(IFACE_TTL, ri, r, ttl, IDBM_SHOW, num, 1);
|
||||
+ } else if (iface_type == ISCSI_IFACE_TYPE_IPV6) {
|
||||
+ __recinfo_str(IFACE_IPV6_AUTOCFG, ri, r, ipv6_autocfg,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_LINKLOCAL_AUTOCFG, ri, r, linklocal_autocfg,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_ROUTER_AUTOCFG, ri, r, router_autocfg,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_str(IFACE_LINKLOCAL, ri, r, ipv6_linklocal, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_str(IFACE_ROUTER, ri, r, ipv6_router, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_uint8(IFACE_DUP_ADDR_DETECT_CNT, ri, r,
|
||||
+ dup_addr_detect_cnt, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint32(IFACE_FLOW_LABEL, ri, r, flow_label, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_str(IFACE_GRAT_NEIGHBOR_ADV, ri, r,
|
||||
+ gratuitous_neighbor_adv, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint8(IFACE_HOP_LIMIT, ri, r, hop_limit, IDBM_SHOW,
|
||||
+ num, 1);
|
||||
+ __recinfo_str(IFACE_MLD, ri, r, mld, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint32(IFACE_ND_REACHABLE_TMO, ri, r,
|
||||
+ nd_reachable_tmo, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint32(IFACE_ND_REXMIT_TIME, ri, r, nd_rexmit_time,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint32(IFACE_ND_STALE_TMO, ri, r, nd_stale_tmo,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint32(IFACE_RTR_ADV_LINK_MTU, ri, r,
|
||||
+ router_adv_link_mtu, IDBM_SHOW, num, 1);
|
||||
+ __recinfo_uint8(IFACE_TRAFFIC_CLASS, ri, r, traffic_class,
|
||||
+ IDBM_SHOW, num, 1);
|
||||
+ }
|
||||
+
|
||||
__recinfo_str(IFACE_DELAYED_ACK, ri, r, delayed_ack, IDBM_SHOW, num, 1);
|
||||
__recinfo_str(IFACE_TCP_NAGLE, ri, r, nagle, IDBM_SHOW, num, 1);
|
||||
__recinfo_str(IFACE_TCP_WSF_STATE, ri, r, tcp_wsf_state, IDBM_SHOW,
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -55,6 +55,17 @@ Patch38: 0038-README-changes-to-use-long-option-index-instead-of-f.patch
|
||||
Patch39: 0039-iscsiadm-Add-support-to-set-CHAP-entry-using-host-ch.patch
|
||||
Patch40: 0040-iscsi-tools-Correctly-get-username_in-and-password_i.patch
|
||||
Patch41: 0041-README-changes-for-adding-support-to-set-CHAP-entry.patch
|
||||
Patch42: 0042-iscsi-tools-Setup-iface-conf-file-with-all-iface-att.patch
|
||||
Patch43: 0043-iscsi_if.h-Remove-numbers-used-for-network-parameter.patch
|
||||
Patch44: 0044-iscsi_if.h-Additional-parameters-for-network-param-s.patch
|
||||
Patch45: 0045-iscsi-tools-Use-macro-to-set-IPv4-IPv6-IP-addresses.patch
|
||||
Patch46: 0046-iscsi-tools-Use-single-function-to-enable-disable-ne.patch
|
||||
Patch47: 0047-iscsi-tools-Use-single-function-to-set-integer-netwo.patch
|
||||
Patch48: 0048-iscsi-tools-Ignore-network-parameter-if-not-enabled-.patch
|
||||
Patch49: 0049-iscsi-tools-Additional-parameters-for-network-settin.patch
|
||||
Patch50: 0050-iscsi-tools-iface-params-should-be-updated-for-node_.patch
|
||||
Patch51: 0051-iscsi-tools-Let-default-type-of-iface-be-ipv4.patch
|
||||
Patch52: 0052-iscsi-tools-Show-iface-params-based-on-iface-type.patch
|
||||
|
||||
# not (yet) upstream merged
|
||||
Patch143: 0143-idmb_rec_write-check-for-tpgt-first.patch
|
||||
@ -149,6 +160,17 @@ developing applications that use %{name}.
|
||||
%patch39 -p1
|
||||
%patch40 -p1
|
||||
%patch41 -p1
|
||||
%patch42 -p1
|
||||
%patch43 -p1
|
||||
%patch44 -p1
|
||||
%patch45 -p1
|
||||
%patch46 -p1
|
||||
%patch47 -p1
|
||||
%patch48 -p1
|
||||
%patch49 -p1
|
||||
%patch50 -p1
|
||||
%patch51 -p1
|
||||
%patch52 -p1
|
||||
# pending upstream merge
|
||||
%patch143 -p1
|
||||
%patch145 -p1
|
||||
@ -325,6 +347,7 @@ fi
|
||||
- refresh boot session info patches to final version from upstream,
|
||||
fixes context issues with later patches
|
||||
- 1006156, 1006161 Add/Update entries in chap table through Open-iSCSI
|
||||
- 948134 extend support to set additional parameters for network configuration
|
||||
|
||||
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 6.2.0.873-18
|
||||
- Mass rebuild 2014-01-24
|
||||
|
Loading…
Reference in New Issue
Block a user