PDU processing when crc_flag true
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- c
- Domain
- networking
Research direction
Start with the CRC declaration and comments in fsw/src/cf_logical_pdu.h around lines 358-365, then inspect FD PDU processing in fsw/src/cf_cfdp.c around lines 726-737. Verify how crc_flag affects data_len and how EOF and FIN decoding reaches CF_CFDP_DecodeAllTlv. Done means CRC-present PDUs are handled consistently without dropping file data or causing decoding errors.
Written by the indexing model from the issue text.
Description
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
The issue involves a difference in interpretation of the CFDP specification. In particular, the format and processing of CFDP PDUs when the PDU header indicates CRC present.
For FD PDUs, the code ignores 4 bytes instead of 2 bytes for the CRC at the end of the PDU (see context). That will result in ignoring the last 2 bytes of file data from FD PDUs encoded with a CRC.
If an EOF or FIN PDU is received with CRC present, the CRC at the end will (almost always) cause a decoding error in CF_CFDP_DecodeAllTlv called by CF_CFDP_DecodeEof/CF_CFDP_DecodeFin.
To Reproduce
Unknown.
If helpful, I could provide what I believe to be valid CFDP PDUs and show how their processing differs from my expectation.
Expected behavior
The software could refuse PDUs with crc_flag true,
or, preferably, it could decrement the data_len of (all) PDUs with crc_flag true by 2 (bytes).
Code snips
This code has the per PDU CRC declaration:
https://github.com/nasa/CF/blob/281a94188cd7d885a5aed01ee041f3ece2b0486f/fsw/src/cf_logical_pdu.h#L365
The comments on lines 358-363 do not match my understanding.
File data processing excerpt:
https://github.com/nasa/CF/blob/281a94188cd7d885a5aed01ee041f3ece2b0486f/fsw/src/cf_cfdp.c#L726-737
System observed on:
N/A
Additional context
Unfortunately, the CFDP standard 4.1 CRC PROCEDURES has an external reference for the CRC and the reference is wrong:
4.1.3.1 The CRC computation algorithm shall be the standard CCSDS Telecommand CRC
algorithm specified in 4.2.1.3 of the CCSDS Telecommand Recommendation (reference [4]).
and 232.0-B-3 section 4.2.1.3 does not specify a CRC.
However, the only CRC in 232.0-B-3 is defined in 4.1.4 Frame Error Control Word as a 2 octet field.
Reporter Info
Bob Wiegand, NASA/GSFC
- Dominant language
- C
- Stars
- 123
- Forks
- 82
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 2
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nasa/CF
-
CF_CFDP_S_SendFileData computes the file checksum from the SB buffer after CFE_SB_TransmitBufferOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Assert checks non-existent variable (`pt`) in `CF_CFDP_ProcessPlaybackDirectory()`May be free again A pull request for this issue was closed without being merged. Openinvalid
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Similar issues
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
389ds/389-ds-base#8251 ·
Maintainers usually reply within 1 day
-
bug data-types
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
ClickHouse/clickhouse-cpp#645 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ROCm/hrx-system#3628 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
OpenPrinting/cups#1844 ·
Maintainers usually reply within 1 day