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

Structs serialised into USB buffers in cdc_ncm are not guaranteed to produce the right bytes #3686

Open
Eekle opened this issue Dec 25, 2024 · 0 comments

Comments

@Eekle
Copy link
Contributor

Eekle commented Dec 25, 2024

For example:

#[repr(packed)]
#[allow(unused)]
struct NtbParameters {
length: u16,
formats_supported: u16,
in_params: NtbParametersDir,
out_params: NtbParametersDir,
}

repr(packed) is not sufficient to guarantee that fields in memory remain in the order they are written, and endianness means that the multibyte fields might not match in memory and on the wire.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant