summaryrefslogtreecommitdiff
path: root/src/udev/net
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-02-19 22:37:13 +0100
committerTom Gundersen <teg@jklm.no>2014-02-19 23:29:51 +0100
commite51660ae56bb747ece2cab8fe6eec37f4d06a438 (patch)
tree5202cf4709bc2b5acfcdc394c274ebea24685bf6 /src/udev/net
parentdd8875f9396d2de31260915bda9c4c85b350003d (diff)
udev: net-config - allow interface names to be set from the hwdb
Diffstat (limited to 'src/udev/net')
-rw-r--r--src/udev/net/link-config.c4
-rw-r--r--src/udev/net/link-config.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c
index 3afaff10c8..d05b909913 100644
--- a/src/udev/net/link-config.c
+++ b/src/udev/net/link-config.c
@@ -383,6 +383,9 @@ int link_config_apply(link_config_ctx *ctx, link_config *config, struct udev_dev
for (policy = config->name_policy; !new_name && *policy != _NAMEPOLICY_INVALID; policy++) {
switch (*policy) {
+ case NAMEPOLICY_DATABASE:
+ new_name = udev_device_get_property_value(device, "ID_NET_NAME_FROM_DATABASE");
+ break;
case NAMEPOLICY_ONBOARD:
new_name = udev_device_get_property_value(device, "ID_NET_NAME_ONBOARD");
break;
@@ -447,6 +450,7 @@ DEFINE_STRING_TABLE_LOOKUP(mac_policy, MACPolicy);
DEFINE_CONFIG_PARSE_ENUM(config_parse_mac_policy, mac_policy, MACPolicy, "Failed to parse MAC address policy");
static const char* const name_policy_table[] = {
+ [NAMEPOLICY_DATABASE] = "database",
[NAMEPOLICY_ONBOARD] = "onboard",
[NAMEPOLICY_SLOT] = "slot",
[NAMEPOLICY_PATH] = "path",
diff --git a/src/udev/net/link-config.h b/src/udev/net/link-config.h
index a55c6f5f05..4fc8963114 100644
--- a/src/udev/net/link-config.h
+++ b/src/udev/net/link-config.h
@@ -38,6 +38,7 @@ typedef enum MACPolicy {
} MACPolicy;
typedef enum NamePolicy {
+ NAMEPOLICY_DATABASE,
NAMEPOLICY_ONBOARD,
NAMEPOLICY_SLOT,
NAMEPOLICY_PATH,