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; |
|
}; |
These structs, which represent a region of memory, should have
__attribute__((packed)), sincememcpy()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).libnetflow9/src/decode.cpp
Lines 13 to 30 in 3d74939