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

Fix eui 64 based ipv6 addresses #615

Merged
merged 2 commits into from
Sep 10, 2024

Conversation

rical
Copy link
Contributor

@rical rical commented Sep 10, 2024

Description

This PR fixes the EUI-64 based IPv6 autoconf address on bridges and updates the IGMP basic test.

The EUI-64 address is fixed by explicitly assigning the base mac address to the bridge when creating it. Strangely, this messes with some timing in the bridge, causing the first multicast querier message sent to the bridge from user-space to be lost. This is caused by the bridge using the "NOOP" scheduler (noop_enqueue()) for a short period of time while the interface is starting up. To avoid the test-case failing when this happens we introduce a retry that will wait for the second query message. This is a bit strange in the case of a software device such as a bridge, i.e. it might be a bug. However, loosing the first query isn't strange in the case of a normal HW interface. That's how we justify the retry loop.

troglobit and others added 2 commits September 10, 2024 16:21
To prevent the kernel from setting a random mac address on new bridges,
before we have added any bridge ports, we create bridges using the:

  1. Custom mac address from the configuration (phys-address)
  2. System base mac from /run/system.json
  3. None, if there is no base mac address in system.json, e.g. r2s

Fixes kernelkit#357

Signed-off-by: Joachim Wiberg <[email protected]>
There's a case where the first query is lost due to the network just
starting up. To handle this we introduce a retry loop in the test case
that waits for a second query message to be sent.

In this commit we also lower the query interval to speed up the case
when the first message is lost. Ideally mcd (the underlying multicast
daemon) should implement a Startup Query Interval to send it even
faster.

Signed-off-by: Richard Alpe <[email protected]>
Copy link
Contributor

@troglobit troglobit left a comment

Choose a reason for hiding this comment

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

Great stuff, thank you so much for diving down this rabbit hole! 🥇

@troglobit troglobit merged commit 1f74ebf into kernelkit:main Sep 10, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IPv6 auto-conf for bridge interfaces gets random link identifier instead of MAC based (eui64)
2 participants