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

Trigger topo change on every link up after link down #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
13 changes: 10 additions & 3 deletions bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ struct bridge_member {
uint16_t pvid;
bool present;
bool active;
bool has_link_down;
char name[];
};

Expand Down Expand Up @@ -782,6 +783,11 @@ bridge_member_cb(struct device_user *dep, enum device_event ev)
DEV_OPT_MTU | DEV_OPT_MTU6);
break;
case DEV_EVENT_LINK_UP:
if (!bst->has_vlans && !dev->settings.auth && bm->has_link_down) {
device_broadcast_event(&bst->dev, DEV_EVENT_TOPO_CHANGE);
}
bm->has_link_down = false;

if (!bst->has_vlans)
break;

Expand All @@ -791,10 +797,11 @@ bridge_member_cb(struct device_user *dep, enum device_event ev)
uloop_timeout_set(&bm->check_timer, 1000);
break;
case DEV_EVENT_LINK_DOWN:
if (!dev->settings.auth)
break;
bm->has_link_down = true;

if (dev->settings.auth)
bridge_disable_member(bm, true);

bridge_disable_member(bm, true);
break;
case DEV_EVENT_REMOVE:
if (dep->hotplug && !dev->sys_present) {
Expand Down