From 7c47cf75f415df17539e38ec8aac740ae0d05e9d Mon Sep 17 00:00:00 2001 From: Patrick Huesmann Date: Wed, 27 Jan 2021 13:02:57 +0100 Subject: [PATCH] Fix double bridge detection in get_max_(req|rsp)_data_size() Signed-off-by: Patrick Huesmann --- src/plugins/ipmi_intf.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/ipmi_intf.c b/src/plugins/ipmi_intf.c index f09c289..501d4b0 100644 --- a/src/plugins/ipmi_intf.c +++ b/src/plugins/ipmi_intf.c @@ -508,7 +508,7 @@ ipmi_intf_get_max_request_data_size(struct ipmi_intf * intf) /* check if request size is not specified */ if (!size) { /* - * The IPMB standard overall message length for ‘non -bridging’ + * The IPMB standard overall message length for non-bridging * messages is specified as 32 bytes, maximum, including slave * address. This sets the upper limit for typical IPMI messages. * With the exception of messages used for bridging messages to @@ -541,7 +541,8 @@ ipmi_intf_get_max_request_data_size(struct ipmi_intf * intf) } /* check for double bridging */ - if (intf->transit_addr && intf->transit_addr != intf->target_addr) { + if (intf->transit_addr && + (intf->transit_addr != intf->target_addr || intf->transit_channel != intf->target_channel) { /* subtract inner send message request size */ size -= 8; } @@ -565,7 +566,7 @@ ipmi_intf_get_max_response_data_size(struct ipmi_intf * intf) /* check if response size is not specified */ if (!size) { /* - * The IPMB standard overall message length for ‘non -bridging’ + * The IPMB standard overall message length for non-bridging * messages is specified as 32 bytes, maximum, including slave * address. This sets the upper limit for typical IPMI messages. * With the exception of messages used for bridging messages to @@ -603,7 +604,8 @@ ipmi_intf_get_max_response_data_size(struct ipmi_intf * intf) } /* check for double bridging */ - if (intf->transit_addr && intf->transit_addr != intf->target_addr) { + if (intf->transit_addr && + (intf->transit_addr != intf->target_addr || intf->transit_channel != intf->target_channel) { /* subtract inner send message header size */ size -= 8; }