Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
udevd: `Could not generate persistent MAC address for $name: No such file or directory` #3374
Comments
tomty89
referenced this issue
May 28, 2016
Closed
networkd: bond created by networkd has a different "MAC behavior" than those created by kernel/ip #3375
poettering
added
bug
network
udev
labels
May 30, 2016
|
So this is the cause of the issue:
which does not really make sense for "virtual devices" (i.e. bridge, bond...), but they are "affected" since we generally defaults to MACAddressPolicy=persistent. What do you think, @teg? Do you think this makes sense?
|
poettering
added this to the v231 milestone
Jun 7, 2016
|
Hm... I see the problem. But not sure I follow the patch. I guess what we want is in case the name of a device is set explicitly (i.e., one created from userspace), we can just use that as a seed for the MAC, that's what you are doing here, right? |
|
If I got that right, I think a better way is, in case the current logic fails, to look at |
poettering
removed this from the v231 milestone
Jul 22, 2016
|
Well I guess it's alright to use However, be noted that it will not cover virtual device that does not have the Shall we replace the following:
with:
|
This was referenced Sep 5, 2016
nezero
commented
Dec 22, 2016
|
Is there a reason the proposed fix hasn't been applied? This is blocking OpenVPN being able to bridge in some configurations. |
naphthalene
commented
Jan 16, 2017
|
Ping |
aboch
referenced this issue
in moby/moby
Feb 13, 2017
Closed
Can't ping containers across swarm overlay network #30972
grafi-tt
commented
Feb 22, 2017
|
@tomty89 @teg @poettering I made the patch, and confirmed it is working for a bridge device.
|
alfonsovng
referenced this issue
in moby/moby
Feb 23, 2017
Open
Docker swarm is restarting containers very often #31286
grafi-tt
commented
Feb 24, 2017
|
I noticed that the above patch didn't fixed the issue for tun/tap devices. |
alfonsovng
commented
Feb 24, 2017
|
Please @grafi-tt , can you share your patch? Thanks |
djvdorp
commented
Mar 2, 2017
•
|
Any update on this matter? This also seems to cause issues for me in systemd v232 when using LXC: /var/log/syslog:
lxc-start output (as root) that triggers the above syslog entry:
A patch or workaround, maybe from @grafi-tt, would be greatly appreciated as I am stuck right now. |
pawiecki
commented
Mar 8, 2017
|
As @nezero mentioned earlier, it affects OpenVPN on Fedora. Fedora 25
|
|
@grafi-tt I'm not sure what ioctl interface you were referring to but make you are aware the names of the virtual devices are not always "set from userspace", like the case of bond0 that is created upon the loading of the bonding modules (with default parameters, that said). Also NET_NAME_USER may not be the only type that you want to "skip" (if we consider should_rename to be the reference, so you may want a clone of it here instead, or something like that that is sane in terms of programming) I am not really sure it is the right way to address the issue though. As I said, virtual device that is not exactly created by user will still make udev error out. I wonder if we need to by some means make udev actually ignore them when it applies the MACAddressPolicy in any case, so that this issue is fully addressed. |
freddysdad
commented
Mar 20, 2017
|
any update on this one? it's still breaking openvpn |
djvdorp
commented
Mar 21, 2017
|
Another bump from me as this is rather annoying to work with, because you can't. |
|
For those who are having problem with this, you should be able work around it by copying Now it makes me wonder what's the point of Physical devices mostly have "real" MAC Address which are inheritly persistent. Virtual devices created by users can be assigned with one explicitly if a random one is not acceptable. "Enumerated" device in special cases (e.g. bond0 created by the bonding module with its default parameter) probably wont have acceptable seed for persistent MAC Address generation anyway. So how come there should be a MAC policy applied by default "generally"? Let's say in some of the cases we do not want typical behavior, shouldn't that be switched per device or at most per type though? @teg @poettering What do you think? Do you think we should/can at least change the default policy from persistent to none, until anyone is willing to spend time on making the option sensible? |
grafi-tt
commented
Mar 30, 2017
|
@alfonsovng Sorry for the late response. diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index cc88cd7856f5..6ddda452884d 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1777,6 +1777,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
}
else {
char *name;
+ unsigned char name_assign_type = NET_NAME_ENUM;
unsigned long flags = 0;
int queues = ifr->ifr_flags & IFF_MULTI_QUEUE ?
MAX_TAP_QUEUES : 1;
@@ -1799,11 +1800,13 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
} else
return -EINVAL;
- if (*ifr->ifr_name)
+ if (*ifr->ifr_name) {
name = ifr->ifr_name;
+ name_assign_type = NET_NAME_USER;
+ }
dev = alloc_netdev_mqs(sizeof(struct tun_struct), name,
- NET_NAME_UNKNOWN, tun_setup, queues,
+ name_assign_type, tun_setup, queues,
queues);
if (!dev)@tomty89 Thank you for pointing out the bond0 example. I don't have specific opinion, but maybe it is acceptable to just put warning when the name bond0 is matched. (If I understand correctly, there is another unsolved problem associated with bond0. https://bugs.freedesktop.org/show_bug.cgi?id=82956) |
This was referenced May 9, 2017
freddysdad
commented
Jul 4, 2017
|
wow, over 12 months since initial report, still breaking openvpn and still no fix. why? |
mbiebl
deleted a comment from
jmiahman
Jul 5, 2017
chanderson0
referenced this issue
in coreos/bugs
Jul 5, 2017
Open
Docker hangs and unable to reboot #1998
|
Bugs don't fix themselves. Generally, the best way to ensure a bug is fixed is becoming active yourself. We rely on contributions, like any Open Source project does. We have a lot of work to do, and may priorize things differently from you, I hope that's understandable. that's why we can't work on all issues that arise with the same pressure. We are happy however for any contributions from outside |
poettering
deleted a comment from
jmiahman
Jul 11, 2017
poettering
deleted a comment from
unitylinux
Jul 12, 2017
1605200517
commented
Aug 2, 2017
|
@poettering @grafi-tt To start with,
|
GamerSource
commented
Sep 5, 2017
•
The last patch regarding TUN device from @grafi-tt is a Linux Kernel patch, not a systemd one. |
1605200517
commented
Sep 7, 2017
|
@GamerSource thank you; currently we no more get this |
sathieu
commented
Oct 25, 2017
•
|
I've added (systemd 232, Debian 9 stretch): # /etc/systemd/network/99-default.link
[Link]
NamePolicy=kernel database onboard slot path
MACAddressPolicy=none |
tomty89 commentedMay 28, 2016
Submission type
systemd version the issue has been seen with
230
Used distribution
Arch Linux
In case of bug report: Expected behaviour you didn't see
no message is logged when I add an interface with
ip linkIn case of bug report: Unexpected behaviour you saw
Could not generate persistent MAC address for $name: No such file or directorylogged when I add an interface (e.g. bridge, bond) withip link. If I create them with networkd/.netdev, no such message is logged.In case of bug report: Steps to reproduce the problem
[tom@localhost ~]$ sudo ip l add name br0 type bridge
[tom@localhost ~]$ sudo ip l add name bond1 type bond
[tom@localhost ~]$ journalctl -b -u systemd-udevd
-- Logs begin at Wed 2016-05-04 14:49:19 HKT, end at Sat 2016-05-28 15:39:18 HKT. --
May 28 15:39:13 localhost systemd-udevd[351]: Could not generate persistent MAC address for br0: No such file or directory
May 28 15:39:18 localhost systemd-udevd[358]: Could not generate persistent MAC address for bond0: No such file or directory
May 28 15:39:18 localhost systemd-udevd[357]: Could not generate persistent MAC address for bond1: No such file or directory