Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct the accounting of outgoing RPC fragment sizes #546

Merged
merged 2 commits into from
Jun 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/device/pf_cmrpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4422,7 +4422,8 @@ static int pf_cmrpc_dce_packet (
{
LOG_ERROR (
PF_RPC_LOG,
"CMRPC(%d): Incoming fragments exceed max buffer\n",
"CMRPC(%d): Incoming RPC message exceeds buffer size."
" If possible, increase PNET_MAX_SESSION_BUFFER_SIZE.\n",
__LINE__);
pf_set_error (
&p_sess->rpc_result,
Expand Down Expand Up @@ -4740,6 +4741,13 @@ static int pf_cmrpc_dce_packet (

/* Update how much the controller has received (ack'ed) */
p_sess->out_buf_sent_pos += p_sess->out_buf_send_len;
if (p_sess->out_fragment_nbr > 0)
{
/* For all but the first fragment, we have accounted for
* the header size an additional time. Correct that here.
*/
p_sess->out_buf_sent_pos -= PF_CMRPC_PDU_HEADER_SIZE;
}
p_sess->out_fragment_nbr++;

/* The fragment acknowledgment is valid (expected) */
Expand Down