-
Notifications
You must be signed in to change notification settings - Fork 21
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
tblCRCTool hardcodes table file header size #3
Comments
Can you give an example of what you are referring to? |
The issue is about skipSize hardcoded to 116. Not clear where that number comes from, but likely related to CFE_FS_Header_t and/or CFE_TBL_File_Hdr_t (as seen in the CFE_TBL_LoadCmd from cfe/fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.c) Take a look at that code and see if you can figure it out. |
Fix #3, hardcode table file header size
Reviewed and approved at 2019-09-04 CCB
Reviewed and approved at 2019-09-04 CCB
I found that the proposed fix for this is breaking the ability to build this tool as a standalone item, which I thought was the whole point of it -- to have a standalone tool independent of CFE or elf2cfetbl that can re-compute a compatible CRC value. I recommend reverting this change set. |
Upon further review, I don't see the number "116" as random at all; The CFE TBL header is defined as containing certain binary fields of a certain size and this actually should be fixed in this particular case, just like the size of e.g. a UDP or Ethernet header is defined and fixed. Using "sizeof()" here actually introduces more potential problems than existed before. |
@jphickey I approach the use case for this tool differently. We need a ground tool that calculates the CRC such that we can verify the reported CRC from cFE is as expected. There's no requirement for this tool to be completely stand alone. In my view this now does exactly what I want, and removing the hardcoded header side increases maintainability vs using a "magic number". The point is not to checksum everything but the first 116 bytes. The point is to calculate the checksum in the same way the cFS will do it in flight, to be able to confirm the file on the ground matches what was loaded. |
@jphickey I'd actually prefer if it was built with the rest of the system (with cmake), like cmdUtil and elf2cfetbl. It's not really stand alone. |
From #8, I concur with the improvements (add CMakelists.txt, fix nasa/cFE#25, remove Makefile, and clean up header includes if possible). Then we'll re-review. |
nasa/cFE#25 has been merged, this can now be implemented. |
sizeof() will keep this tool in sync if the size of the CFE file or table header should ever change. Note this also implicitly restricts this tool to the CFE build environment where these headers are available. As a result this will no longer be buildable as a fully standalone/external tool.
Fix #3, use sizeof() for header sizes.
Maintenance issue with hardcoded header size in tblCRCTool
The text was updated successfully, but these errors were encountered: