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

BMP Stats Report non-counter/non-gauge types not fully supported #162

Closed
digizeph opened this issue Apr 5, 2024 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@digizeph
Copy link
Member

digizeph commented Apr 5, 2024

Specifically, based on RFC7854 Stats Report type 9 and 10 are not 4-byte counter or 8-byte gauge, and we currently assume all values needs to be 4 or 8 bytes and thus causing false corrupted-message errors.

image

More in RFC8671 type 16 and 17.

image

Code snippets that needs revision:

pub enum StatsData {
Counter(u32),
Gauge(u64),
}

let stat_data = match stat_len {
4 => StatsData::Counter(data.read_u32()?),
8 => StatsData::Gauge(data.read_u64()?),
_ => return Err(ParserBmpError::CorruptedBmpMessage),

@digizeph digizeph added the bug Something isn't working label Apr 5, 2024
@digizeph digizeph self-assigned this Apr 5, 2024
Copy link

linear bot commented Apr 5, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant