-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Workaround for systemd 242 assigning MAC addr for virtual devices #8351
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
Conversation
Added the needs backport labels as all Cilium versions are affected. |
test-me-please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
test-me-please |
Bit surprised the veth pair isn't given a MAC already by whoever created it but OK. Patches LGTM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Please also add a release note to the PR description to explain that this fixes compatibility with systemd 242.
(http://docs.cilium.io/en/latest/contributing/#submitting-a-pull-request step 9 if you need the formatting)
Also, do we need to do this for IPVLAN devices?
CI failed due to:
Retrying. |
test-me-please |
|
@brb needs rebase. |
A generated MAC addr is unicast and locally administered. Signed-off-by: Martynas Pumputis <m@lambda.lt>
To include the change which allows to specify veth peer mac address (vishvananda/netlink#460). Signed-off-by: Martynas Pumputis <m@lambda.lt>
systemd 242+ tries to set a "persistent" MAC addr for any virtual device by default (controlled by MACAddressPolicy). As setting happens asynchronously after a device has been created, ep.Mac and ep.HostMac can become stale which has a serious consequence - the kernel will drop any packet sent to/from the endpoint. However, we can trick systemd by explicitly setting MAC addrs for both veth ends. This sets addr_assign_type for NET_ADDR_SET which prevents systemd from changing the addrs. Signed-off-by: Martynas Pumputis <m@lambda.lt>
To work around the systemd 242+ feature which tries to assign a persistent MAC address for any device by default (see commit message of the previous commit for more details). Signed-off-by: Martynas Pumputis <m@lambda.lt>
test-me-please |
This PR introduces a workaround for preventing the systemd 242+ from assigning MAC addrs for virtual devices after they have been created. The trick is to set a MAC addr when creating such device. This sets
addr_assign_type
toNET_ADDR_SET
which makes the systemd to skip re-assigning of the MAC addr: https://github.com/systemd/systemd/blob/v242/src/udev/net/link-config.c#L292.Note that we don't apply the same trick to ipvlan slave devices, as they inherit a MAC addr from their master, so they bypass the issue.
See #8304 for more details about the systemd feature and what it causes to Cilium.
Fix #8304.
This change is