-
Notifications
You must be signed in to change notification settings - Fork 52
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
Preserve unknown bitmask bits values in PDUs (eliminate use of 'from_bits_truncate') #217
Comments
Following up on this. Looks like a new syntax was added to the macro in bitflags! {
pub struct Flags: u32 {
const A = 0b00000001;
const B = 0b00000010;
const C = 0b00000100;
// The source may set any bits
const _ = !0; // <- this guy
}
} There is crate-level documentation for this: https://docs.rs/bitflags/2.4.0/bitflags/#externally-defined-flags This is basically making So I suggest this:
EDIT: see also bitflags/bitflags#363 for background |
Be tolerant when parsing unknown flags. Related to: Devolutions#217 Signed-off-by: Marc-André Lureau <[email protected]>
Be tolerant when parsing unknown flags. Related to: Devolutions#217 Signed-off-by: Marc-André Lureau <[email protected]>
Be tolerant when parsing unknown flags. Related to: Devolutions#217 Signed-off-by: Marc-André Lureau <[email protected]>
Be tolerant when parsing unknown flags. Related to: Devolutions#217 Signed-off-by: Marc-André Lureau <[email protected]>
Be tolerant when parsing unknown flags. Related to: Devolutions#217 Signed-off-by: Marc-André Lureau <[email protected]>
Be tolerant when parsing unknown flags. Related to: Devolutions#217 Signed-off-by: Marc-André Lureau <[email protected]>
Be tolerant when parsing unknown flags. Related to: Devolutions#217 Signed-off-by: Marc-André Lureau <[email protected]>
Be tolerant when parsing unknown flags. Related to: #217 Signed-off-by: Marc-André Lureau <[email protected]>
To prevent losing information after PDU encode/decode roundtrip, we should always keep bitmask values unchanged, but currently, we use
from_bits_truncate
excessively in the codebase. As @CBenoit explained in the comment, we need to avoid usage offrom_bits_truncate
:The text was updated successfully, but these errors were encountered: