[Pkg-iscsi-maintainers] [open-iscsi] 15/48: iscsi tools: Ignore network parameter if not enabled/disabled
Ritesh Raj Sarraf
rrs at moszumanska.debian.org
Wed Aug 20 13:54:09 UTC 2014
This is an automated email from the git hooks/post-receive script.
rrs pushed a commit to branch upstream-mnc
in repository open-iscsi.
commit da404f2137daa4e5cf06d69e4d7b6a0bff8c13b5
Author: Harish Zunjarrao <harish.zunjarrao at qlogic.com>
Date: Fri Oct 18 09:29:23 2013 -0400
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 at qlogic.com>
Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi at qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary at 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, \
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-iscsi/open-iscsi.git
More information about the Pkg-iscsi-maintainers
mailing list