bridge: reset primary on adding device to empty bridge#50
Open
wryun wants to merge 1 commit intoopenwrt:masterfrom
Open
bridge: reset primary on adding device to empty bridge#50wryun wants to merge 1 commit intoopenwrt:masterfrom
wryun wants to merge 1 commit intoopenwrt:masterfrom
Conversation
This means that when only wireless devices are on a bridge, the MAC is set to something predictable (otherwise a random MAC is used which differs on each bring-up).
2304841 to
45fbb02
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This means that when only wireless devices are on a bridge, set the MAC to something predictable.
EDIT: I raised this too quickly. I've realised now that the MAC address is set by br_stp_recalculate_bridge_id (kernel) to whatever the lowest MAC of a device that's added to the bridge, which gives a deterministic mac address at the end regardless of bring-up order, whereas this PR would have non-determinism depending on when the device was added. It's still useful for use because we rely on a deterministic mac address during bring-up in order for wpa_supplicant to set its mac address to the bridge mac address (as this makes assoclist/getHostHints better).
This seems to work as I would expect. However, I'm not familiar with netifd internals so I've probably missed something, and there may be a connected issue where if you remove devices so that the bridge is empty then add it will consider the MAC address already set and will refuse to reset_primary (see bridge_reset_primary). I haven't tried to change this, as it looks like it would require additional state.