Here is a short patch that allows for longer requests and replies using ipmitool raw.

--Vernon
>From d2e7728622fcd6264538d9bad410f25113552283 Mon Sep 17 00:00:00 2001
From: Vernon Mauery <vernon.mau...@intel.com>
Date: Fri, 3 Nov 2017 14:37:46 -0700
Subject: [PATCH] ID:497 Raw command to allow responses larger than 256 bytes

A full response (though not very likely) could be as large a a full UDP
packet over RMCP+. In theory other interfaces could have an even larger
size, but this is a pretty good compromise for now.

Signed-off-by: Vernon Mauery <vernon.mau...@linux.intel.com>
---
 include/ipmitool/ipmi.h | 3 ++-
 lib/ipmi_raw.c          | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/ipmitool/ipmi.h b/include/ipmitool/ipmi.h
index 6e42d06..7821f14 100644
--- a/include/ipmitool/ipmi.h
+++ b/include/ipmitool/ipmi.h
@@ -45,7 +45,8 @@
 # include <config.h>
 #endif
 
-#define IPMI_BUF_SIZE 1024
+/* The maximum buffer size is slightly less than a full UDP packet */
+#define IPMI_BUF_SIZE 65536
 #define IPMI_MAX_MD_SIZE 0x20
 
 #if HAVE_PRAGMA_PACK
diff --git a/lib/ipmi_raw.c b/lib/ipmi_raw.c
index 92c0177..7802748 100644
--- a/lib/ipmi_raw.c
+++ b/lib/ipmi_raw.c
@@ -320,7 +320,7 @@ ipmi_raw_main(struct ipmi_intf * intf, int argc, char ** argv)
 	uint8_t netfn, cmd, lun;
 	uint16_t netfn_tmp = 0;
 	int i;
-	uint8_t data[256];
+	uint8_t data[IPMI_BUF_SIZE];
 
 	if (argc == 1 && strncmp(argv[0], "help", 4) == 0) {
 		ipmi_raw_help();
-- 
2.7.4

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ipmitool-devel mailing list
Ipmitool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel

Reply via email to