SHA256
1
0
forked from pool/ipmitool
ipmitool/ipmitool-1_8_16_HEAD.patch
Thomas Renninger 570b85101b Accepting request 361388 from home:trenn:branches:systemsmanagement
- Update to latest ipmitool source code
  commit 9020b67347f46554009591ae91e4fa8875c65dfa
  Date:   Tue Jan 12 21:16:37 2016 +0500
- Fix memleak: bnc#968105
Add: ipmitool-sol_memleak.patch

OBS-URL: https://build.opensuse.org/request/show/361388
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/ipmitool?expand=0&rev=35
2016-02-25 13:26:31 +00:00

98 lines
3.5 KiB
Diff

diff --git a/lib/hpm2.c b/lib/hpm2.c
index 6420629..f13be07 100644
--- a/lib/hpm2.c
+++ b/lib/hpm2.c
@@ -128,7 +128,7 @@ int hpm2_get_capabilities(struct ipmi_intf * intf,
#endif
/* check HPM.2 revision */
- if (caps->hpm2_revision_id != HPM2_REVISION) {
+ if (caps->hpm2_revision_id == 0) {
lprintf(LOG_NOTICE, "Bad HPM.2 revision, rev=%d",
caps->hpm2_revision_id);
return -1;
diff --git a/lib/ipmi_fru.c b/lib/ipmi_fru.c
index 40f98e7..5ca6466 100644
--- a/lib/ipmi_fru.c
+++ b/lib/ipmi_fru.c
@@ -5042,6 +5042,11 @@ ipmi_fru_set_field_string_rebuild(struct ipmi_intf * intf, uint8_t fruId,
header.offset.product += change_size_by_8;
}
+ if ((f_type == 'c' ) || (f_type == 'b' ) || (f_type == 'p' )) {
+ printf("Change multi offset from %d to %d\n", header.offset.multi, header.offset.multi + change_size_by_8);
+ header.offset.multi += change_size_by_8;
+ }
+
/* Adjust length of the section */
if (f_type == 'c')
{
diff --git a/lib/ipmi_sel.c b/lib/ipmi_sel.c
index 5df66a7..fbdccd9 100644
--- a/lib/ipmi_sel.c
+++ b/lib/ipmi_sel.c
@@ -419,7 +419,12 @@ ipmi_sel_add_entries_fromfile(struct ipmi_intf * intf, const char * filename)
memset(&sel_event, 0, sizeof(struct sel_event_record));
sel_event.record_id = 0x0000;
sel_event.record_type = 0x02;
- sel_event.sel_type.standard_type.gen_id = 0x00;
+ /*
+ * IPMI spec §32.1 generator ID
+ * Bit 0 = 1 "Software defined"
+ * Bit 1-7: SWID (IPMI spec §5.5), using 2 = "System management software"
+ */
+ sel_event.sel_type.standard_type.gen_id = 0x41;
sel_event.sel_type.standard_type.evm_rev = rqdata[0];
sel_event.sel_type.standard_type.sensor_type = rqdata[1];
sel_event.sel_type.standard_type.sensor_num = rqdata[2];
diff --git a/lib/ipmi_user.c b/lib/ipmi_user.c
index 6074209..e339c2a 100644
--- a/lib/ipmi_user.c
+++ b/lib/ipmi_user.c
@@ -590,7 +590,7 @@ ipmi_user_priv(struct ipmi_intf *intf, int argc, char **argv)
user_access.user_id);
return (-1);
} else {
- printf("Set Privilege Level command successful (user %d)",
+ printf("Set Privilege Level command successful (user %d)\n",
user_access.user_id);
return 0;
}
@@ -602,6 +602,7 @@ ipmi_user_mod(struct ipmi_intf *intf, int argc, char **argv)
/* Disable / Enable */
uint8_t user_id;
uint8_t operation;
+ uint8_t ccode;
if (argc != 2) {
print_user_usage();
@@ -613,8 +614,14 @@ ipmi_user_mod(struct ipmi_intf *intf, int argc, char **argv)
operation = (strncmp(argv[0], "disable", 7) == 0) ?
IPMI_PASSWORD_DISABLE_USER : IPMI_PASSWORD_ENABLE_USER;
- return _ipmi_set_user_password(intf, user_id, operation,
+ ccode = _ipmi_set_user_password(intf, user_id, operation,
(char *)NULL, 0);
+ if (eval_ccode(ccode) != 0) {
+ lprintf(LOG_ERR, "Set User Password command failed (user %d)",
+ user_id);
+ return (-1);
+ }
+ return 0;
}
int
diff --git a/src/plugins/ipmi_intf.c b/src/plugins/ipmi_intf.c
index 19ba5e3..090ab2f 100644
--- a/src/plugins/ipmi_intf.c
+++ b/src/plugins/ipmi_intf.c
@@ -451,7 +451,7 @@ ipmi_intf_socket_connect(struct ipmi_intf * intf)
}
/* OK, now try to connect with the scope id from this interface address */
- if (addr6->sin6_scope_id != 0) {
+ if (addr6->sin6_scope_id != 0 || !IN6_IS_ADDR_LINKLOCAL(&tmp6->sin6_addr)) {
if (connect(intf->fd, rp->ai_addr, rp->ai_addrlen) != -1) {
hints.ai_family = rp->ai_family;
lprintf(LOG_DEBUG, "Successful connected on %s interface with scope id %d", ifa->ifa_name, tmp6->sin6_scope_id);