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

cnetlink: only check bridge for vlan_filtering on creation #429

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions src/netlink/cnetlink.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,6 @@ void cnetlink::link_created(rtnl_link *link) noexcept {
case LT_BRIDGE_SLAVE: // a new bridge slave was created
try {
auto master = rtnl_link_get_master(link);
uint8_t vlan_filtering = 0;

// check for new bridge slaves
if (master == 0) {
Expand Down Expand Up @@ -1321,22 +1320,23 @@ void cnetlink::link_created(rtnl_link *link) noexcept {
auto br_link = get_link_by_ifindex(master);
LOG(INFO) << __FUNCTION__ << ": using bridge " << br_link.get();

// we only support vlan aware bridges
if (rtnl_link_bridge_get_vlan_filtering(br_link.get(), &vlan_filtering) <
0 ||
vlan_filtering != 1) {
LOG(WARNING)
<< __FUNCTION__
<< ": unsupported bridge: configured with vlan_filtering 0";
ignored_bridges.insert(master);
return;
}

bool new_bridge = false;
// slave interface
// use only the first bridge an interface is attached to
// XXX TODO more bridges!
if (bridge == nullptr) {
uint8_t vlan_filtering = 0;

// we only support vlan aware bridges
if (rtnl_link_bridge_get_vlan_filtering(br_link.get(),
&vlan_filtering) < 0 ||
vlan_filtering != 1) {
LOG(WARNING)
<< __FUNCTION__
<< ": unsupported bridge: configured with vlan_filtering 0";
ignored_bridges.insert(master);
return;
}
bridge = new nl_bridge(this->swi, port_man, this, vlan, vxlan);
bridge->set_bridge_interface(br_link.get());
vxlan->register_bridge(bridge);
Expand Down
Loading