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

Check of reserved bits in BitMasks #48

Open
ajoaoff opened this issue Jun 28, 2021 · 0 comments
Open

Check of reserved bits in BitMasks #48

ajoaoff opened this issue Jun 28, 2021 · 0 comments

Comments

@ajoaoff
Copy link

ajoaoff commented Jun 28, 2021

Original issue opened by @erickvermot at kytos#313.

Reserved bits in BitMasks that are not set to 0 should lead to the message beeing rejected (pg52).
Curently, foundation/base/GenericBitMask is not checking for bits that do not have a _enum item.

Maybe implement it in the MetaBitMask, doing something like

USED_BITS = sum([value for key, value in _enum])
RESERVED_BITS = ~USED_BITS

and before the GenericBitMask parses the bits, check that RESERVED_BITS & bitmask == 0.

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

2 participants