summaryrefslogtreecommitdiffstats
path: root/src/udev
diff options
context:
space:
mode:
Diffstat (limited to 'src/udev')
-rw-r--r--src/udev/net/link-config-gperf.gperf1
-rw-r--r--src/udev/net/link-config.c5
-rw-r--r--src/udev/net/link-config.h1
3 files changed, 7 insertions, 0 deletions
diff --git a/src/udev/net/link-config-gperf.gperf b/src/udev/net/link-config-gperf.gperf
index c6ff796efc..e0212bbc18 100644
--- a/src/udev/net/link-config-gperf.gperf
+++ b/src/udev/net/link-config-gperf.gperf
@@ -35,6 +35,7 @@ Link.MACAddressPolicy, config_parse_mac_address_policy, 0,
Link.MACAddress, config_parse_hwaddr, 0, offsetof(link_config, mac)
Link.NamePolicy, config_parse_name_policy, 0, offsetof(link_config, name_policy)
Link.Name, config_parse_ifname, 0, offsetof(link_config, name)
+Link.AlternativeName, config_parse_ifnames, 1, offsetof(link_config, alternative_names)
Link.Alias, config_parse_ifalias, 0, offsetof(link_config, alias)
Link.MTUBytes, config_parse_mtu, AF_UNSPEC, offsetof(link_config, mtu)
Link.BitsPerSecond, config_parse_si_size, 0, offsetof(link_config, speed)
diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c
index 7b07e2f38f..6879cfee07 100644
--- a/src/udev/net/link-config.c
+++ b/src/udev/net/link-config.c
@@ -58,6 +58,7 @@ static void link_config_free(link_config *link) {
free(link->mac);
free(link->name_policy);
free(link->name);
+ strv_free(link->alternative_names);
free(link->alias);
free(link);
@@ -458,6 +459,10 @@ int link_config_apply(link_config_ctx *ctx, link_config *config,
if (r < 0)
return log_warning_errno(r, "Could not set Alias=, MACAddress= or MTU= on %s: %m", old_name);
+ r = rtnl_set_link_alternative_names(&ctx->rtnl, ifindex, config->alternative_names);
+ if (r < 0)
+ return log_warning_errno(r, "Could not set AlternativeName= on %s: %m", old_name);
+
*name = new_name;
return 0;
diff --git a/src/udev/net/link-config.h b/src/udev/net/link-config.h
index 52a02b9b09..b5073548ab 100644
--- a/src/udev/net/link-config.h
+++ b/src/udev/net/link-config.h
@@ -48,6 +48,7 @@ struct link_config {
MACAddressPolicy mac_address_policy;
NamePolicy *name_policy;
char *name;
+ char **alternative_names;
char *alias;
uint32_t mtu;
size_t speed;