mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 10:37:22 +00:00
ID:369 - Fix lanplus interface bridging and response matching
Request/response matching for bridged and double-bridged requests is broken. This patch reworks the sending and command construction code, and fixes the response matching problems. Since the polling code is retried several times, it was moved into a separate function in order to make the code more readable. Commit for: Dmitry Bazhenov
This commit is contained in:
parent
c87aa0b96a
commit
6dec83ff5d
@ -601,7 +601,7 @@ ipmiv2_lan_ping(struct ipmi_intf * intf)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* ipmi_lan_poll_recv
|
* ipmi_lan_poll_single
|
||||||
*
|
*
|
||||||
* Receive whatever comes back. Ignore received packets that don't correspond
|
* Receive whatever comes back. Ignore received packets that don't correspond
|
||||||
* to a request we've sent.
|
* to a request we've sent.
|
||||||
@ -609,99 +609,88 @@ ipmiv2_lan_ping(struct ipmi_intf * intf)
|
|||||||
* Returns: the ipmi_rs packet describing the/a reponse we expect.
|
* Returns: the ipmi_rs packet describing the/a reponse we expect.
|
||||||
*/
|
*/
|
||||||
static struct ipmi_rs *
|
static struct ipmi_rs *
|
||||||
ipmi_lan_poll_recv(struct ipmi_intf * intf)
|
ipmi_lan_poll_single(struct ipmi_intf * intf)
|
||||||
{
|
{
|
||||||
struct rmcp_hdr rmcp_rsp;
|
struct rmcp_hdr * rmcp_rsp;
|
||||||
struct ipmi_rs * rsp;
|
struct ipmi_rs * rsp;
|
||||||
struct ipmi_session * session = intf->session;
|
struct ipmi_session * session = intf->session;
|
||||||
int offset, rv;
|
int offset, rv;
|
||||||
uint16_t payload_size;
|
uint16_t payload_size;
|
||||||
uint8_t ourAddress = intf->my_addr;
|
|
||||||
|
|
||||||
if (ourAddress == 0) {
|
|
||||||
ourAddress = IPMI_BMC_SLAVE_ADDR;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/* receive packet */
|
||||||
rsp = ipmi_lan_recv_packet(intf);
|
rsp = ipmi_lan_recv_packet(intf);
|
||||||
|
|
||||||
|
/* check if no packet has come */
|
||||||
|
if (rsp == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* parse response headers */
|
||||||
|
rmcp_rsp = (struct rmcp_hdr *)rsp->data;
|
||||||
|
|
||||||
|
if (rmcp_rsp->class == RMCP_CLASS_ASF) {
|
||||||
|
/* might be ping response packet */
|
||||||
|
rv = ipmi_handle_pong(intf, rsp);
|
||||||
|
return (rv <= 0) ? NULL : rsp;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rmcp_rsp->class != RMCP_CLASS_IPMI) {
|
||||||
|
lprintf(LOG_DEBUG, "Invalid RMCP class: %x", rmcp_rsp->class);
|
||||||
|
/* read one more packet */
|
||||||
|
return (struct ipmi_rs *)1;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Not positive why we're looping. Do we sometimes get stuff we don't
|
* The authtype / payload type determines what we are receiving
|
||||||
* expect?
|
|
||||||
*/
|
*/
|
||||||
while (rsp != NULL) {
|
offset = 4;
|
||||||
|
|
||||||
/* parse response headers */
|
/*--------------------------------------------------------------------
|
||||||
memcpy(&rmcp_rsp, rsp->data, 4);
|
*
|
||||||
|
* The current packet could be one of several things:
|
||||||
|
*
|
||||||
|
* 1) An IPMI 1.5 packet (the response to our GET CHANNEL
|
||||||
|
* AUTHENTICATION CAPABILITIES request)
|
||||||
|
* 2) An RMCP+ message with an IPMI reponse payload
|
||||||
|
* 3) AN RMCP+ open session response
|
||||||
|
* 4) An RAKP-2 message (response to an RAKP 1 message)
|
||||||
|
* 5) An RAKP-4 message (response to an RAKP 3 message)
|
||||||
|
* 6) A Serial Over LAN packet
|
||||||
|
* 7) An Invalid packet (one that doesn't match a request)
|
||||||
|
* -------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
if (rmcp_rsp.class == RMCP_CLASS_ASF) {
|
read_session_data(rsp, &offset, intf->session);
|
||||||
/* might be ping response packet */
|
|
||||||
rv = ipmi_handle_pong(intf, rsp);
|
|
||||||
return (rv <= 0) ? NULL : rsp;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rmcp_rsp.class != RMCP_CLASS_IPMI) {
|
if (lanplus_has_valid_auth_code(rsp, intf->session) == 0) {
|
||||||
lprintf(LOG_DEBUG, "Invalid RMCP class: %x",
|
lprintf(LOG_ERR, "ERROR: Received message with invalid authcode!");
|
||||||
rmcp_rsp.class);
|
return NULL;
|
||||||
rsp = ipmi_lan_recv_packet(intf);
|
}
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if ((session->v2_data.session_state == LANPLUS_STATE_ACTIVE) &&
|
||||||
|
(rsp->session.authtype == IPMI_SESSION_AUTHTYPE_RMCP_PLUS) &&
|
||||||
|
(rsp->session.bEncrypted)) {
|
||||||
|
lanplus_decrypt_payload(session->v2_data.crypt_alg,
|
||||||
|
session->v2_data.k2,
|
||||||
|
rsp->data + offset,
|
||||||
|
rsp->session.msglen,
|
||||||
|
rsp->data + offset,
|
||||||
|
&payload_size);
|
||||||
|
} else {
|
||||||
|
payload_size = rsp->session.msglen;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The authtype / payload type determines what we are receiving
|
* Handle IPMI responses (case #1 and #2) -- all IPMI reponses
|
||||||
*/
|
*/
|
||||||
offset = 4;
|
if (rsp->session.payloadtype == IPMI_PAYLOAD_TYPE_IPMI) {
|
||||||
|
struct ipmi_rq_entry * entry;
|
||||||
|
int payload_start = offset;
|
||||||
|
int extra_data_length;
|
||||||
|
int loop = 1;
|
||||||
|
|
||||||
|
while (loop--) {
|
||||||
/*--------------------------------------------------------------------
|
/* fill-in response data */
|
||||||
*
|
|
||||||
* The current packet could be one of several things:
|
|
||||||
*
|
|
||||||
* 1) An IPMI 1.5 packet (the response to our GET CHANNEL
|
|
||||||
* AUTHENTICATION CAPABILITIES request)
|
|
||||||
* 2) An RMCP+ message with an IPMI reponse payload
|
|
||||||
* 3) AN RMCP+ open session response
|
|
||||||
* 4) An RAKP-2 message (response to an RAKP 1 message)
|
|
||||||
* 5) An RAKP-4 message (response to an RAKP 3 message)
|
|
||||||
* 6) A Serial Over LAN packet
|
|
||||||
* 7) An Invalid packet (one that doesn't match a request)
|
|
||||||
* -------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
read_session_data(rsp, &offset, intf->session);
|
|
||||||
|
|
||||||
if (lanplus_has_valid_auth_code(rsp, intf->session) == 0)
|
|
||||||
{
|
|
||||||
lprintf(LOG_ERR, "ERROR: Received message with invalid authcode!");
|
|
||||||
rsp = ipmi_lan_recv_packet(intf);
|
|
||||||
assert(0);
|
|
||||||
//continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((session->v2_data.session_state == LANPLUS_STATE_ACTIVE) &&
|
|
||||||
(rsp->session.authtype == IPMI_SESSION_AUTHTYPE_RMCP_PLUS) &&
|
|
||||||
(rsp->session.bEncrypted))
|
|
||||||
|
|
||||||
{
|
|
||||||
lanplus_decrypt_payload(session->v2_data.crypt_alg,
|
|
||||||
session->v2_data.k2,
|
|
||||||
rsp->data + offset,
|
|
||||||
rsp->session.msglen,
|
|
||||||
rsp->data + offset,
|
|
||||||
&payload_size);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
payload_size = rsp->session.msglen;
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Handle IPMI responses (case #1 and #2) -- all IPMI reponses
|
|
||||||
*/
|
|
||||||
if (rsp->session.payloadtype == IPMI_PAYLOAD_TYPE_IPMI)
|
|
||||||
{
|
|
||||||
struct ipmi_rq_entry * entry;
|
|
||||||
int payload_start = offset;
|
|
||||||
int extra_data_length;
|
|
||||||
read_ipmi_response(rsp, &offset);
|
read_ipmi_response(rsp, &offset);
|
||||||
|
|
||||||
lprintf(LOG_DEBUG+1, "<< IPMI Response Session Header");
|
lprintf(LOG_DEBUG+1, "<< IPMI Response Session Header");
|
||||||
@ -737,158 +726,129 @@ ipmi_lan_poll_recv(struct ipmi_intf * intf)
|
|||||||
entry = ipmi_req_lookup_entry(rsp->payload.ipmi_response.rq_seq,
|
entry = ipmi_req_lookup_entry(rsp->payload.ipmi_response.rq_seq,
|
||||||
rsp->payload.ipmi_response.cmd);
|
rsp->payload.ipmi_response.cmd);
|
||||||
|
|
||||||
if (entry != NULL) {
|
if (entry == NULL) {
|
||||||
lprintf(LOG_DEBUG+2, "IPMI Request Match found");
|
lprintf(LOG_INFO, "IPMI Request Match NOT FOUND");
|
||||||
if ( intf->target_addr != intf->my_addr &&
|
/* read one more packet */
|
||||||
bridgePossible &&
|
return (struct ipmi_rs *)1;
|
||||||
rsp->data_len &&
|
};
|
||||||
rsp->payload.ipmi_response.cmd == 0x34 &&
|
|
||||||
(rsp->payload.ipmi_response.netfn == 0x06 ||
|
uint8_t target_cmd = entry->req.msg.target_cmd;
|
||||||
rsp->payload.ipmi_response.netfn == 0x07) &&
|
|
||||||
rsp->payload.ipmi_response.rs_lun == 0 )
|
lprintf(LOG_DEBUG+2, "IPMI Request Match found");
|
||||||
{
|
|
||||||
/* Check completion code */
|
if (entry->bridging_level) {
|
||||||
if (rsp->data[offset-1] == 0)
|
/* Check completion code */
|
||||||
{
|
if (rsp->ccode) {
|
||||||
lprintf(LOG_DEBUG, "Bridged command answer,"
|
lprintf(LOG_DEBUG, "WARNING: Bridged "
|
||||||
" waiting for next answer... ");
|
"cmd ccode = 0x%02x", rsp->ccode);
|
||||||
ipmi_req_remove_entry(
|
} else {
|
||||||
rsp->payload.ipmi_response.rq_seq,
|
/* decrement bridging level */
|
||||||
rsp->payload.ipmi_response.cmd);
|
entry->bridging_level--;
|
||||||
return ipmi_lan_poll_recv(intf);
|
if (!entry->bridging_level) {
|
||||||
}
|
entry->req.msg.cmd = entry->req.msg.target_cmd;
|
||||||
else
|
|
||||||
{
|
|
||||||
lprintf(LOG_DEBUG, "WARNING: Bridged "
|
|
||||||
"cmd ccode = 0x%02x",
|
|
||||||
rsp->data[offset-1]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rsp->data_len &&
|
/* check if bridged response is embedded */
|
||||||
rsp->payload.ipmi_response.cmd == 0x34) {
|
if (payload_size > 8) {
|
||||||
memcpy(rsp->data, &rsp->data[offset],
|
printbuf(&rsp->data[offset], (rsp->data_len-offset-1),
|
||||||
(rsp->data_len-offset));
|
"bridge command response");
|
||||||
if (verbose > 2)
|
/*
|
||||||
printbuf( &rsp->data[offset],
|
* decrement payload size
|
||||||
(rsp->data_len-offset),
|
* (cks2 for outer Send Message)
|
||||||
"bridge command response");
|
*/
|
||||||
|
payload_size--;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* need to make a loop for embedded bridged response
|
||||||
|
*/
|
||||||
|
loop++;
|
||||||
|
} else {
|
||||||
|
lprintf(LOG_DEBUG, "Bridged command answer,"
|
||||||
|
" waiting for next answer... ");
|
||||||
|
/* read one more packet */
|
||||||
|
return (struct ipmi_rs *)1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ipmi_req_remove_entry(rsp->payload.ipmi_response.rq_seq,
|
|
||||||
rsp->payload.ipmi_response.cmd);
|
|
||||||
} else {
|
|
||||||
lprintf(LOG_INFO, "IPMI Request Match NOT FOUND");
|
|
||||||
rsp = ipmi_lan_recv_packet(intf);
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Remove request entry */
|
||||||
|
ipmi_req_remove_entry(rsp->payload.ipmi_response.rq_seq,
|
||||||
|
rsp->payload.ipmi_response.cmd);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Good packet. Shift response data to start of array.
|
* Good packet. Shift response data to start of array.
|
||||||
* rsp->data becomes the variable length IPMI response data
|
* rsp->data becomes the variable length IPMI response data
|
||||||
* rsp->data_len becomes the length of that data
|
* rsp->data_len becomes the length of that data
|
||||||
*/
|
*/
|
||||||
extra_data_length = payload_size - (offset - payload_start) - 1;
|
extra_data_length = payload_size - (offset - payload_start) - 1;
|
||||||
if (rsp != NULL && extra_data_length)
|
if (extra_data_length) {
|
||||||
{
|
|
||||||
rsp->data_len = extra_data_length;
|
rsp->data_len = extra_data_length;
|
||||||
memmove(rsp->data, rsp->data + offset, extra_data_length);
|
memmove(rsp->data, rsp->data + offset, extra_data_length);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
rsp->data_len = 0;
|
rsp->data_len = 0;
|
||||||
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
* Open Response
|
||||||
/*
|
*/
|
||||||
* Open Response
|
} else if (rsp->session.payloadtype ==
|
||||||
*/
|
IPMI_PAYLOAD_TYPE_RMCP_OPEN_RESPONSE) {
|
||||||
else if (rsp->session.payloadtype ==
|
if (session->v2_data.session_state !=
|
||||||
IPMI_PAYLOAD_TYPE_RMCP_OPEN_RESPONSE)
|
LANPLUS_STATE_OPEN_SESSION_SENT) {
|
||||||
{
|
lprintf(LOG_ERR, "Error: Received an Unexpected Open Session "
|
||||||
if (session->v2_data.session_state !=
|
|
||||||
LANPLUS_STATE_OPEN_SESSION_SENT)
|
|
||||||
{
|
|
||||||
lprintf(LOG_ERR, "Error: Received an Unexpected Open Session "
|
|
||||||
"Response");
|
"Response");
|
||||||
rsp = ipmi_lan_recv_packet(intf);
|
/* read one more packet */
|
||||||
continue;
|
return (struct ipmi_rs *)1;
|
||||||
}
|
|
||||||
|
|
||||||
read_open_session_response(rsp, offset);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
read_open_session_response(rsp, offset);
|
||||||
|
/*
|
||||||
/*
|
* RAKP 2
|
||||||
* RAKP 2
|
*/
|
||||||
*/
|
} else if (rsp->session.payloadtype == IPMI_PAYLOAD_TYPE_RAKP_2) {
|
||||||
else if (rsp->session.payloadtype == IPMI_PAYLOAD_TYPE_RAKP_2)
|
if (session->v2_data.session_state != LANPLUS_STATE_RAKP_1_SENT) {
|
||||||
{
|
lprintf(LOG_ERR, "Error: Received an Unexpected RAKP 2 message");
|
||||||
if (session->v2_data.session_state != LANPLUS_STATE_RAKP_1_SENT)
|
/* read one more packet */
|
||||||
{
|
return (struct ipmi_rs *)1;
|
||||||
lprintf(LOG_ERR, "Error: Received an Unexpected RAKP 2 message");
|
|
||||||
rsp = ipmi_lan_recv_packet(intf);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
read_rakp2_message(rsp, offset, session->v2_data.auth_alg);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
read_rakp2_message(rsp, offset, session->v2_data.auth_alg);
|
||||||
|
/*
|
||||||
/*
|
* RAKP 4
|
||||||
* RAKP 4
|
*/
|
||||||
*/
|
} else if (rsp->session.payloadtype == IPMI_PAYLOAD_TYPE_RAKP_4) {
|
||||||
else if (rsp->session.payloadtype == IPMI_PAYLOAD_TYPE_RAKP_4)
|
if (session->v2_data.session_state != LANPLUS_STATE_RAKP_3_SENT) {
|
||||||
{
|
lprintf(LOG_ERR, "Error: Received an Unexpected RAKP 4 message");
|
||||||
if (session->v2_data.session_state != LANPLUS_STATE_RAKP_3_SENT)
|
/* read one more packet */
|
||||||
{
|
return (struct ipmi_rs *)1;
|
||||||
lprintf(LOG_ERR, "Error: Received an Unexpected RAKP 4 message");
|
|
||||||
rsp = ipmi_lan_recv_packet(intf);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
read_rakp4_message(rsp, offset, session->v2_data.auth_alg);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
read_rakp4_message(rsp, offset, session->v2_data.auth_alg);
|
||||||
|
/*
|
||||||
|
* SOL
|
||||||
|
*/
|
||||||
|
} else if (rsp->session.payloadtype == IPMI_PAYLOAD_TYPE_SOL) {
|
||||||
|
int payload_start = offset;
|
||||||
|
int extra_data_length;
|
||||||
|
|
||||||
|
if (session->v2_data.session_state != LANPLUS_STATE_ACTIVE) {
|
||||||
/*
|
lprintf(LOG_ERR, "Error: Received an Unexpected SOL packet");
|
||||||
* SOL
|
/* read one more packet */
|
||||||
*/
|
return (struct ipmi_rs *)1;
|
||||||
else if (rsp->session.payloadtype == IPMI_PAYLOAD_TYPE_SOL)
|
|
||||||
{
|
|
||||||
int payload_start = offset;
|
|
||||||
int extra_data_length;
|
|
||||||
|
|
||||||
if (session->v2_data.session_state != LANPLUS_STATE_ACTIVE)
|
|
||||||
{
|
|
||||||
lprintf(LOG_ERR, "Error: Received an Unexpected SOL packet");
|
|
||||||
rsp = ipmi_lan_recv_packet(intf);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
read_sol_packet(rsp, &offset);
|
|
||||||
extra_data_length = payload_size - (offset - payload_start);
|
|
||||||
if (rsp && extra_data_length)
|
|
||||||
{
|
|
||||||
rsp->data_len = extra_data_length;
|
|
||||||
memmove(rsp->data, rsp->data + offset, extra_data_length);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
rsp->data_len = 0;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
read_sol_packet(rsp, &offset);
|
||||||
else
|
extra_data_length = payload_size - (offset - payload_start);
|
||||||
{
|
if (rsp && extra_data_length) {
|
||||||
lprintf(LOG_ERR, "Invalid RMCP+ payload type : 0x%x",
|
rsp->data_len = extra_data_length;
|
||||||
|
memmove(rsp->data, rsp->data + offset, extra_data_length);
|
||||||
|
} else {
|
||||||
|
rsp->data_len = 0;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Unknown Payload type
|
||||||
|
*/
|
||||||
|
} else {
|
||||||
|
lprintf(LOG_ERR, "Invalid RMCP+ payload type : 0x%x",
|
||||||
rsp->session.payloadtype);
|
rsp->session.payloadtype);
|
||||||
assert(0);
|
/* read one more packet */
|
||||||
}
|
return (struct ipmi_rs *)1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rsp;
|
return rsp;
|
||||||
@ -896,6 +856,30 @@ ipmi_lan_poll_recv(struct ipmi_intf * intf)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* ipmi_lan_poll_recv
|
||||||
|
*
|
||||||
|
* Receive whatever comes back. Ignore received packets that don't correspond
|
||||||
|
* to a request we've sent.
|
||||||
|
*
|
||||||
|
* Returns: the ipmi_rs packet describing the/a reponse we expect.
|
||||||
|
*/
|
||||||
|
static struct ipmi_rs *
|
||||||
|
ipmi_lan_poll_recv(struct ipmi_intf * intf)
|
||||||
|
{
|
||||||
|
struct ipmi_rs * rsp;
|
||||||
|
|
||||||
|
do {
|
||||||
|
/* poll single packet */
|
||||||
|
rsp = ipmi_lan_poll_single(intf);
|
||||||
|
} while (rsp == (struct ipmi_rs *) 1);
|
||||||
|
|
||||||
|
return rsp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* read_open_session_reponse
|
* read_open_session_reponse
|
||||||
*
|
*
|
||||||
@ -1412,7 +1396,7 @@ void getIpmiPayloadWireRep(
|
|||||||
tmp = len - cs;
|
tmp = len - cs;
|
||||||
msg[len++] = ipmi_csum(msg+cs, tmp);
|
msg[len++] = ipmi_csum(msg+cs, tmp);
|
||||||
cs3 = len;
|
cs3 = len;
|
||||||
msg[len++] = intf->my_addr;
|
msg[len++] = IPMI_REMOTE_SWID;
|
||||||
msg[len++] = curr_seq << 2;
|
msg[len++] = curr_seq << 2;
|
||||||
msg[len++] = 0x34; /* Send Message rqst */
|
msg[len++] = 0x34; /* Send Message rqst */
|
||||||
#if 0 /* From lan.c example */
|
#if 0 /* From lan.c example */
|
||||||
@ -1435,7 +1419,10 @@ void getIpmiPayloadWireRep(
|
|||||||
bridgePossible);
|
bridgePossible);
|
||||||
|
|
||||||
/* rsAddr */
|
/* rsAddr */
|
||||||
msg[len++] = intf->target_addr; /* IPMI_BMC_SLAVE_ADDR; */
|
if (bridgedRequest)
|
||||||
|
msg[len++] = intf->target_addr;
|
||||||
|
else
|
||||||
|
msg[len++] = IPMI_BMC_SLAVE_ADDR;
|
||||||
|
|
||||||
/* net Fn */
|
/* net Fn */
|
||||||
msg[len++] = req->msg.netfn << 2 | (req->msg.lun & 3);
|
msg[len++] = req->msg.netfn << 2 | (req->msg.lun & 3);
|
||||||
@ -1446,7 +1433,7 @@ void getIpmiPayloadWireRep(
|
|||||||
cs = len;
|
cs = len;
|
||||||
|
|
||||||
/* rqAddr */
|
/* rqAddr */
|
||||||
if (!bridgedRequest)
|
if (bridgedRequest < 2)
|
||||||
msg[len++] = IPMI_REMOTE_SWID;
|
msg[len++] = IPMI_REMOTE_SWID;
|
||||||
else /* Bridged message */
|
else /* Bridged message */
|
||||||
msg[len++] = intf->my_addr;
|
msg[len++] = intf->my_addr;
|
||||||
@ -1696,7 +1683,7 @@ ipmi_lanplus_build_v2x_msg(
|
|||||||
curr_seq);
|
curr_seq);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IPMI_PAYLOAD_TYPE_SOL:
|
case IPMI_PAYLOAD_TYPE_SOL:
|
||||||
getSolPayloadWireRep(intf,
|
getSolPayloadWireRep(intf,
|
||||||
msg + IPMI_LANPLUS_OFFSET_PAYLOAD,
|
msg + IPMI_LANPLUS_OFFSET_PAYLOAD,
|
||||||
payload);
|
payload);
|
||||||
@ -1896,26 +1883,26 @@ ipmi_lanplus_build_v2x_ipmi_cmd(
|
|||||||
|
|
||||||
|
|
||||||
/* IPMI Message Header -- Figure 13-4 of the IPMI v2.0 spec */
|
/* IPMI Message Header -- Figure 13-4 of the IPMI v2.0 spec */
|
||||||
if ((intf->target_addr == intf->my_addr) || (!bridgePossible))
|
if ((intf->target_addr == intf->my_addr) || (!bridgePossible)) {
|
||||||
{
|
entry = ipmi_req_add_entry(intf, req, curr_seq);
|
||||||
entry = ipmi_req_add_entry(intf, req, curr_seq);
|
/* it's a bridge command */
|
||||||
}
|
} else {
|
||||||
else /* it's a bridge command */
|
unsigned char backup_cmd;
|
||||||
{
|
|
||||||
unsigned char backup_cmd;
|
|
||||||
|
|
||||||
/* Add entry for cmd */
|
/* Add entry for cmd */
|
||||||
entry = ipmi_req_add_entry(intf, req, curr_seq);
|
entry = ipmi_req_add_entry(intf, req, curr_seq);
|
||||||
|
|
||||||
if(entry)
|
if (entry) {
|
||||||
{
|
entry->req.msg.target_cmd = entry->req.msg.cmd;
|
||||||
/* Add entry for bridge cmd */
|
entry->req.msg.cmd = 0x34;
|
||||||
backup_cmd = req->msg.cmd;
|
|
||||||
req->msg.cmd = 0x34;
|
if (intf->transit_addr &&
|
||||||
entry = ipmi_req_add_entry(intf, req, curr_seq);
|
intf->transit_addr != intf->my_addr)
|
||||||
req->msg.cmd = backup_cmd;
|
entry->bridging_level = 2;
|
||||||
}
|
else
|
||||||
}
|
entry->bridging_level = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (entry == NULL)
|
if (entry == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user