summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-07-15 17:57:43 +0200
committerTom Gundersen <teg@jklm.no>2014-08-08 13:30:15 +0200
commit04b67d49254d956d31bcfe80340fb9df7ed332d3 (patch)
treee47d05d843be4c37d8aec5872e4848b9ab17c6a8 /src/shared
parentf3fc48150bb443f5b4623a819ebc2b39971a4f66 (diff)
udev: link_setup - respect kernel name assign policy
Newer kernels export meta-information about the origin of an ifname. Respect this from the ifname rename logic. We do not rename any interfaces that was originally named by userspace, nor once which have already been renamed from userspace. Moreover, we optionally do not (the default) rename interfaces which the kernel claims to have named in a predictable way.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/missing.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/shared/missing.h b/src/shared/missing.h
index e20f9bdfd3..195edfc672 100644
--- a/src/shared/missing.h
+++ b/src/shared/missing.h
@@ -525,3 +525,23 @@ static inline int setns(int fd, int nstype) {
#ifndef BOND_XMIT_POLICY_ENCAP34
#define BOND_XMIT_POLICY_ENCAP34 4
#endif
+
+#ifndef NET_ADDR_RANDOM
+# define NET_ADDR_RANDOM 1
+#endif
+
+#ifndef NET_NAME_ENUM
+# define NET_NAME_ENUM 1
+#endif
+
+#ifndef NET_NAME_PREDICTABLE
+# define NET_NAME_PREDICTABLE 2
+#endif
+
+#ifndef NET_NAME_USER
+# define NET_NAME_USER 3
+#endif
+
+#ifndef NET_NAME_RENAMED
+# define NET_NAME_RENAMED 4
+#endif