- Don't crash when asked to parse the ppc firmware table more then once
(which can be done from libiscsi) (#491363)
This commit is contained in:
parent
7a4e711fcd
commit
f004b82b5c
@ -3,7 +3,7 @@
|
|||||||
Summary: iSCSI daemon and utility programs
|
Summary: iSCSI daemon and utility programs
|
||||||
Name: iscsi-initiator-utils
|
Name: iscsi-initiator-utils
|
||||||
Version: 6.2.0.870
|
Version: 6.2.0.870
|
||||||
Release: 8%{?dist}
|
Release: 9%{?dist}
|
||||||
Source0: http://www.open-iscsi.org/bits/open-iscsi-2.0-870.1.tar.gz
|
Source0: http://www.open-iscsi.org/bits/open-iscsi-2.0-870.1.tar.gz
|
||||||
Source1: iscsid.init
|
Source1: iscsid.init
|
||||||
Source2: iscsidevs.init
|
Source2: iscsidevs.init
|
||||||
@ -19,7 +19,7 @@ Patch7: open-iscsi-2.0-870.1-add-libiscsi.patch
|
|||||||
Patch8: open-iscsi-2.0-870.1-no-exit.patch
|
Patch8: open-iscsi-2.0-870.1-no-exit.patch
|
||||||
Patch9: open-iscsi-2.0-870.1-ibft-newer-kernel.patch
|
Patch9: open-iscsi-2.0-870.1-ibft-newer-kernel.patch
|
||||||
Patch10: open-iscsi-2.0-870.1-485217.patch
|
Patch10: open-iscsi-2.0-870.1-485217.patch
|
||||||
Patch11: open-iscsi-2.0-870.1-490515-workaround.patch
|
Patch11: open-iscsi-2.0-870.1-fwparam-ppc-crash.patch
|
||||||
|
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
@ -162,6 +162,10 @@ fi
|
|||||||
%{_includedir}/libiscsi.h
|
%{_includedir}/libiscsi.h
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Apr 27 2009 Hans de Goede <hdegoede@redhat.com> 6.2.0.870-9
|
||||||
|
- Don't crash when asked to parse the ppc firmware table more then
|
||||||
|
once (which can be done from libiscsi) (#491363)
|
||||||
|
|
||||||
* Fri Apr 3 2009 Hans de Goede <hdegoede@redhat.com> 6.2.0.870-8
|
* Fri Apr 3 2009 Hans de Goede <hdegoede@redhat.com> 6.2.0.870-8
|
||||||
- Stop the NM script from exiting with an error status when it
|
- Stop the NM script from exiting with an error status when it
|
||||||
didn't do anything (#493411)
|
didn't do anything (#493411)
|
||||||
|
@ -1,45 +0,0 @@
|
|||||||
diff -up open-iscsi-2.0-870.1/include/fw_context.h.workaround open-iscsi-2.0-870.1/include/fw_context.h
|
|
||||||
--- open-iscsi-2.0-870.1/include/fw_context.h.workaround 2009-03-20 15:47:16.000000000 +0100
|
|
||||||
+++ open-iscsi-2.0-870.1/include/fw_context.h 2009-03-20 15:48:03.000000000 +0100
|
|
||||||
@@ -51,5 +51,7 @@ struct boot_context {
|
|
||||||
|
|
||||||
extern int fw_get_entry(struct boot_context *context, const char *filepath);
|
|
||||||
extern void fw_print_entry(struct boot_context *context);
|
|
||||||
+extern int fwparam_ibft_sysfs(struct boot_context *context,
|
|
||||||
+ const char *filepath);
|
|
||||||
|
|
||||||
#endif /* FWPARAM_CONTEXT_H_ */
|
|
||||||
diff -up open-iscsi-2.0-870.1/libiscsi/libiscsi.c.workaround open-iscsi-2.0-870.1/libiscsi/libiscsi.c
|
|
||||||
--- open-iscsi-2.0-870.1/libiscsi/libiscsi.c.workaround 2009-03-20 15:45:28.000000000 +0100
|
|
||||||
+++ open-iscsi-2.0-870.1/libiscsi/libiscsi.c 2009-03-20 15:47:03.000000000 +0100
|
|
||||||
@@ -196,10 +196,10 @@ int libiscsi_discover_firmware(struct li
|
|
||||||
*found_nodes = NULL;
|
|
||||||
|
|
||||||
memset(&fw_entry, 0, sizeof fw_entry);
|
|
||||||
- rc = fw_get_entry(&fw_entry, NULL);
|
|
||||||
+ rc = fwparam_ibft_sysfs(&fw_entry, NULL);
|
|
||||||
if (rc) {
|
|
||||||
strcpy(context->error_str, "Could not read fw values.");
|
|
||||||
- return rc;
|
|
||||||
+ return ENODEV;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(&rec, 0, sizeof rec);
|
|
||||||
@@ -535,7 +535,7 @@ int libiscsi_get_firmware_network_config
|
|
||||||
|
|
||||||
memset(config, 0, sizeof *config);
|
|
||||||
memset(&fw_entry, 0, sizeof fw_entry);
|
|
||||||
- if (fw_get_entry(&fw_entry, NULL))
|
|
||||||
+ if (fwparam_ibft_sysfs(&fw_entry, NULL))
|
|
||||||
return ENODEV;
|
|
||||||
|
|
||||||
config->dhcp = strlen(fw_entry.dhcp) ? 1 : 0;
|
|
||||||
@@ -557,7 +557,7 @@ int libiscsi_get_firmware_initiator_name
|
|
||||||
|
|
||||||
memset(initiatorname, 0, LIBISCSI_VALUE_MAXLEN);
|
|
||||||
memset(&fw_entry, 0, sizeof fw_entry);
|
|
||||||
- if (fw_get_entry(&fw_entry, NULL))
|
|
||||||
+ if (fwparam_ibft_sysfs(&fw_entry, NULL))
|
|
||||||
return ENODEV;
|
|
||||||
|
|
||||||
strncpy(initiatorname, fw_entry.initiatorname,
|
|
55
open-iscsi-2.0-870.1-fwparam-ppc-crash.patch
Normal file
55
open-iscsi-2.0-870.1-fwparam-ppc-crash.patch
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
diff -up open-iscsi-2.0-870.1/utils/fwparam_ibft/fwparam_ppc.c.crash open-iscsi-2.0-870.1/utils/fwparam_ibft/fwparam_ppc.c
|
||||||
|
--- open-iscsi-2.0-870.1/utils/fwparam_ibft/fwparam_ppc.c.crash 2008-11-22 18:06:46.000000000 +0100
|
||||||
|
+++ open-iscsi-2.0-870.1/utils/fwparam_ibft/fwparam_ppc.c 2009-04-27 20:33:33.000000000 +0200
|
||||||
|
@@ -341,6 +341,7 @@ static int loop_devs(const char *devtree
|
||||||
|
int i;
|
||||||
|
char prefix[256];
|
||||||
|
|
||||||
|
+ nic_count = 0;
|
||||||
|
error = nftw(devtree, find_nics, 20, 0);
|
||||||
|
if (error)
|
||||||
|
return error;
|
||||||
|
@@ -352,6 +353,7 @@ static int loop_devs(const char *devtree
|
||||||
|
qsort(niclist, nic_count, sizeof(char *), nic_cmp);
|
||||||
|
|
||||||
|
snprintf(prefix, sizeof(prefix), "%s/%s", devtree, "aliases");
|
||||||
|
+ dev_count = 0;
|
||||||
|
error = nftw(prefix, find_initiator, 20, 0);
|
||||||
|
if (error)
|
||||||
|
return error;
|
||||||
|
@@ -366,8 +368,6 @@ static int loop_devs(const char *devtree
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- if (!error)
|
||||||
|
- putchar('\n');
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -425,7 +425,7 @@ static void fill_context(struct boot_con
|
||||||
|
int fwparam_ppc(struct boot_context *context, const char *filepath)
|
||||||
|
{
|
||||||
|
int error;
|
||||||
|
- int fplen = 0;
|
||||||
|
+ int dev_count;
|
||||||
|
char *devtree;
|
||||||
|
|
||||||
|
/*
|
||||||
|
@@ -435,13 +435,10 @@ int fwparam_ppc(struct boot_context *con
|
||||||
|
* systems that can support iscsi are the ones that provide
|
||||||
|
* the appropriate FCODE with a load method.
|
||||||
|
*/
|
||||||
|
- if (filepath) {
|
||||||
|
- strncat(filename, filepath, FILENAMESZ);
|
||||||
|
- fplen = strlen(filename);
|
||||||
|
- } else
|
||||||
|
- strncat(filename, DT_TOP, FILENAMESZ);
|
||||||
|
-
|
||||||
|
- strncat(filename + fplen, BOOTPATH, FILENAMESZ - fplen);
|
||||||
|
+ if (filepath)
|
||||||
|
+ snprintf(filename, FILENAMESZ, "%s%s", filepath, BOOTPATH);
|
||||||
|
+ else
|
||||||
|
+ snprintf(filename, FILENAMESZ, "%s%s", DT_TOP, BOOTPATH);
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
fprintf(stderr, "%s: file:%s; debug:%d\n", __func__, filename,
|
Loading…
Reference in New Issue
Block a user