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

Added support for L2 BridgeMDB entries #32894

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jauge-technica
Copy link

@jauge-technica jauge-technica commented May 17, 2024

BridgeMDB entries for Ipv4 and Ipv6 have been supported in networkd for some time.
This PR adds support for adding L2 entries in the multicast group database, which was implemented in Linux 5.11

@github-actions github-actions bot added network documentation tests please-review PR is ready for (re-)review by a maintainer labels May 17, 2024
Copy link

Important

An -rc1 tag has been created and a release is being prepared, so please note that PRs introducing new features and APIs will be held back until the new version has been released.

@yuwata yuwata added this to the v257 milestone May 17, 2024
@poettering
Copy link
Member

looks superficially ok, but please have another look at the coding style:

https://systemd.io/CODING_STYLE/#formatting

and make sure that the patch matches this and the rest of the code.

@poettering poettering added reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks and removed please-review PR is ready for (re-)review by a maintainer labels May 22, 2024
@github-actions github-actions bot added please-review PR is ready for (re-)review by a maintainer and removed reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks labels May 22, 2024
"%s: MulticastGroupAddress= is the multicast all nodes address. "
"Ignoring [BridgeMDB] section from line %u.",
mdb->section->filename, mdb->section->line);
}
Copy link
Member

Choose a reason for hiding this comment

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

coding style: no {} for single line if blocks

Copy link
Author

Choose a reason for hiding this comment

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

This one was already here, wasn't added by me. I think it's to make sure no compiler interprets this as "else if", because of the nested if statements.

"Ignoring [BridgeMDB] section from line %u.",
mdb->section->filename, mdb->section->line);

if (mdb->family == AF_INET) {
Copy link
Member

Choose a reason for hiding this comment

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

mght actually be a candidate for switch statement too

Copy link
Author

Choose a reason for hiding this comment

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

All of the L3 checks were already present and I didn't change them. Just changed their indentation to put them in the switch statement.
Changing this into a switch statement sounds like a good idea though, it gets rid of the nested if statements, which force us to use brackets to prevent "else" ambiguity. Should I do it as part of this PR?

Copy link
Author

Choose a reason for hiding this comment

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

It might make sense to check for AF_INET6 on the "else" instead of just catching everything, and putting an "assert_not_reached" on the else case. I'm hesitant to change code behaviour that is not directly related to the L2 BridgeMDB entries, which is the topic of this PR though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

4 participants