Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

Bridge: add support for specifying IFLA_BRIDGE_FLAGS and implement Flags #212

Merged
merged 2 commits into from
Dec 28, 2021

Conversation

flouthoc
Copy link
Contributor

Extends InfoBridge to support Flags

Add support for setting IFLA_BRIDGE_FLAGS to bridge management nested attributes. Can accept flags such BRIDGE_FLAGS_MASTER and BRIDGE_FLAGS_SELF

Add support for setting `IFLA_BRIDGE_FLAGS` to bridge management nested
attributes. Can accept flags such `BRIDGE_FLAGS_MASTER` and
`BRIDGE_FLAGS_SELF`

Signed-off-by: Aditya Rajan <arajan@redhat.com>
Signed-off-by: Aditya Rajan <arajan@redhat.com>
@@ -394,6 +394,11 @@ pub const IFLA_INFO_DATA: u16 = 2;
pub const IFLA_INFO_XSTATS: u16 = 3;
pub const IFLA_INFO_SLAVE_KIND: u16 = 4;
pub const IFLA_INFO_SLAVE_DATA: u16 = 5;
// Bridge flags
pub const IFLA_BRIDGE_FLAGS: u16 = 47;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really wanted this to be 0 but code has implemented IFLA_BR_XXXX for bridge which blocks 0.
I think IFLA_BR_XXXXX should be implemented for a general link not for InfoBridge but trying not to break what is already there.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I don't understand what you mean. Are you saying IFLA_BRIDGE_FLAGS can't be named IFLA_BR_FLAGS?

@flouthoc
Copy link
Contributor Author

@cathay4t @little-dude PTAL

@little-dude
Copy link
Owner

Sorry @flouthoc I'll try to review this tonight

Copy link
Owner

@little-dude little-dude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, I'd just like a clarification about why IFLA_BRIDGE_FLAGS can't be named IFLA_BR_FLAGS like the other link info constants.

@flouthoc
Copy link
Contributor Author

@little-dude I am a bit unsure about using BR since its mentioned everywhere as IFLA_BRIDGE_FLAGS https://coral.googlesource.com/linux-imx/+/refs/tags/4-2/include/uapi/linux/if_bridge.h#118 even in the other netlink bindings.

But I'm fine to change it, if that is needed. Not a problem for me 😄

@little-dude
Copy link
Owner

Sorry for taking so long @flouthoc and thanks for your PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants