mctp-estack: fix MCTP serial parsing and framing with escape sequences#45
mctp-estack: fix MCTP serial parsing and framing with escape sequences#45mark64 wants to merge 1 commit intoCodeConstruct:mainfrom
Conversation
Signed-off-by: Mark Hill <markleehill@gmail.com>
|
The CI failures appear unrelated to this change, but if required I can fix them |
|
nevermind, linux does it the way it is in |
|
It's entirely possible that we have the same issue in the kernel implementation, in which case we could address both... |
That's true, it would have been helpful to have the spec show an example escaped byte sequence to clarify whether escaping applies to the header and CRC, rather than just the data payload. And doing it to the entire packet makes more sense to me as an outside observer. But, this approach does work too, and I'd rather not introduce a compatibility break with already-existing Linux kernel implementations, even if my reading of the spec is what was originally intended. Anyway happy to pursue this PR again if people think it matches the spec and want me to change the kernel too |
|
I have submitted a query with the DMTF, clarification there might be good motivation to get this sorted everywhere. |
Previously, if an MCTP serial packet had an escape sequence in the frame checksum, it would fail to parse in mctp-rs.
The DMTF spec, however, requires that escaping be performed after FCS generation on transmit, and similarly that
escaping be performed before FCS checking on receive, so the current behavior is incorrect.
I fixed the serial.rs code and added some unit tests to cover these cases.