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

Eot packet set to the wrong size #406

Closed
2 tasks done
skliper opened this issue Sep 5, 2023 · 0 comments · Fixed by #407
Closed
2 tasks done

Eot packet set to the wrong size #406

skliper opened this issue Sep 5, 2023 · 0 comments · Fixed by #407
Assignees
Labels
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Sep 5, 2023

Checklist (Please check before submitting)

  • I reviewed the Contributing Guide.
  • I performed a cursory search to see if the bug report is relevant, not redundant, nor in conflict with other tickets.

Describe the bug
Passing 192 (for default OS_MAX_PATH_LEN of 64) instead of 180 due to use of SB buffer size instead of packet size.

CF/fsw/src/cf_cfdp.c

Lines 1706 to 1715 in 5df892e

CF_EotPktBuf_t *PktBuf;
/*
** Get a Message block of memory and initialize it
*/
PktBuf = (CF_EotPktBuf_t *)CFE_SB_AllocateMessageBuffer(sizeof(*PktBuf));
if (PktBuf != NULL)
{
CFE_MSG_Init(&PktBuf->eot.tlm_header.Msg, CFE_SB_ValueToMsgId(CF_EOT_TLM_MID), sizeof(*PktBuf));

CF/fsw/inc/cf_msg.h

Lines 156 to 160 in 5df892e

typedef union
{
CFE_SB_Buffer_t SBBuf; /**< \brief Message buffer for alignment */
CF_EotPacket_t eot; /**< \brief Single end of transaction info packet */
} CF_EotPktBuf_t;

To Reproduce
Can confirm from a cmd/tlm server or inline:
sizeof(CF_EotPktBuf_t) is 192
sizeof(CF_EotPacket_t) is 180

Expected behavior
Pass in the actual packet size, not the SB buffer size which has the most strict alignment/rounding requirements.

Code snips
See above

System observed on:

  • Hardware: docker container
  • OS: Ubuntu 22.04
  • Versions: main

Additional context
None

Reporter Info
Jacob Hageman - NASA/GSFC

@skliper skliper added this to the Equuleus milestone Sep 5, 2023
@skliper skliper self-assigned this Sep 5, 2023
skliper added a commit to skliper/CF that referenced this issue Sep 5, 2023
@chillfig chillfig self-assigned this Sep 7, 2023
@chillfig chillfig added the bug label Sep 7, 2023
dzbaker added a commit that referenced this issue Sep 12, 2023
Fix #406, Pass in correct CF_EotPacket_t size to msg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants