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 which are memcpy()d into should have the packed attribute #4

Open
mkcms opened this issue Jun 6, 2020 · 0 comments
Open

Structs which are memcpy()d into should have the packed attribute #4

mkcms opened this issue Jun 6, 2020 · 0 comments

Comments

@mkcms
Copy link
Contributor

mkcms commented Jun 6, 2020

These structs, which represent a region of memory, should have __attribute__((packed)), since memcpy() is called to copy memory into them. It's only by chance that the library works now (their members happen to be packed together on the platform of choice that the library is tested on).

struct flowset_header
{
uint16_t flowset_id;
uint16_t length;
};
struct data_template_header
{
uint16_t template_id;
uint16_t field_count;
};
struct option_template_header
{
uint16_t template_id;
uint16_t option_scope_length;
uint16_t option_length;
};

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