mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 10:37:22 +00:00
change BUF_SIZE to IPMI_BUF_SIZE
This commit is contained in:
parent
7eee9c5916
commit
c84c9dceba
@ -43,7 +43,7 @@
|
||||
#include <netinet/in.h>
|
||||
#include <ipmitool/helper.h>
|
||||
|
||||
#define BUF_SIZE 1024
|
||||
#define IPMI_BUF_SIZE 1024
|
||||
|
||||
/* From table 13.16 of the IPMI v2 specification */
|
||||
#define IPMI_PAYLOAD_TYPE_IPMI 0x00
|
||||
@ -115,7 +115,7 @@ struct ipmi_v2_payload {
|
||||
} rakp_4_message;
|
||||
|
||||
struct {
|
||||
unsigned char data[BUF_SIZE];
|
||||
unsigned char data[IPMI_BUF_SIZE];
|
||||
unsigned short character_count;
|
||||
unsigned char packet_sequence_number;
|
||||
unsigned char acked_packet_number;
|
||||
@ -148,7 +148,7 @@ struct ipmi_rq_entry {
|
||||
|
||||
struct ipmi_rs {
|
||||
unsigned char ccode;
|
||||
unsigned char data[BUF_SIZE];
|
||||
unsigned char data[IPMI_BUF_SIZE];
|
||||
|
||||
/*
|
||||
* Looks like this is the length of the entire packet, including the RMCP
|
||||
|
@ -256,7 +256,7 @@ struct ipmi_rs * ipmi_lan_recv_packet(struct ipmi_intf * intf)
|
||||
}
|
||||
|
||||
alarm(IPMI_LAN_TIMEOUT);
|
||||
rc = recv(intf->fd, &rsp.data, BUF_SIZE, 0);
|
||||
rc = recv(intf->fd, &rsp.data, IPMI_BUF_SIZE, 0);
|
||||
alarm(0);
|
||||
|
||||
/* the first read may return ECONNREFUSED because the rmcp ping
|
||||
@ -271,7 +271,7 @@ struct ipmi_rs * ipmi_lan_recv_packet(struct ipmi_intf * intf)
|
||||
*/
|
||||
if (rc < 0) {
|
||||
alarm(IPMI_LAN_TIMEOUT);
|
||||
rc = recv(intf->fd, &rsp.data, BUF_SIZE, 0);
|
||||
rc = recv(intf->fd, &rsp.data, IPMI_BUF_SIZE, 0);
|
||||
alarm(0);
|
||||
if (rc < 0) {
|
||||
perror("recv failed");
|
||||
@ -519,7 +519,7 @@ ipmi_lan_poll_recv(struct ipmi_intf * intf)
|
||||
if (rsp && rsp->data_len > x) {
|
||||
rsp->data_len -= x + 1;
|
||||
memmove(rsp->data, rsp->data + x, rsp->data_len);
|
||||
memset(rsp->data + rsp->data_len, 0, BUF_SIZE - rsp->data_len);
|
||||
memset(rsp->data + rsp->data_len, 0, IPMI_BUF_SIZE - rsp->data_len);
|
||||
}
|
||||
|
||||
return rsp;
|
||||
|
@ -282,7 +282,7 @@ ipmi_lan_recv_packet(struct ipmi_intf * intf)
|
||||
}
|
||||
|
||||
alarm(intf->session->timeout);
|
||||
rc = recv(intf->fd, &rsp.data, BUF_SIZE, 0);
|
||||
rc = recv(intf->fd, &rsp.data, IPMI_BUF_SIZE, 0);
|
||||
alarm(0);
|
||||
|
||||
/* the first read may return ECONNREFUSED because the rmcp ping
|
||||
@ -297,7 +297,7 @@ ipmi_lan_recv_packet(struct ipmi_intf * intf)
|
||||
*/
|
||||
if (rc < 0) {
|
||||
alarm(intf->session->timeout);
|
||||
rc = recv(intf->fd, &rsp.data, BUF_SIZE, 0);
|
||||
rc = recv(intf->fd, &rsp.data, IPMI_BUF_SIZE, 0);
|
||||
alarm(0);
|
||||
if (rc < 0) {
|
||||
perror("recv failed");
|
||||
|
Loading…
x
Reference in New Issue
Block a user