diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-06-23 01:44:13 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-07-01 01:24:42 +0900 |
commit | 44005bfb4eaae840e481e7a0d0b74ac9ee418302 (patch) | |
tree | 6fa79fee336f4c0b45800fc84c487d0d670aea56 /src/udev | |
parent | b38de0e9cc1dfd60a89cf9ec998ed94e71610d50 (diff) | |
download | systemd-44005bfb4eaae840e481e7a0d0b74ac9ee418302.tar.gz |
network,udev: add Property= setting in [Match] section
Closes #5665.
Diffstat (limited to 'src/udev')
-rw-r--r-- | src/udev/net/link-config-gperf.gperf | 1 | ||||
-rw-r--r-- | src/udev/net/link-config.c | 5 | ||||
-rw-r--r-- | src/udev/net/link-config.h | 1 |
3 files changed, 5 insertions, 2 deletions
diff --git a/src/udev/net/link-config-gperf.gperf b/src/udev/net/link-config-gperf.gperf index 2bdb3dcb5e..a3d7dec88c 100644 --- a/src/udev/net/link-config-gperf.gperf +++ b/src/udev/net/link-config-gperf.gperf @@ -24,6 +24,7 @@ Match.OriginalName, config_parse_match_ifnames, 0, Match.Path, config_parse_match_strv, 0, offsetof(link_config, match_path) Match.Driver, config_parse_match_strv, 0, offsetof(link_config, match_driver) Match.Type, config_parse_match_strv, 0, offsetof(link_config, match_type) +Match.Property, config_parse_match_property, 0, offsetof(link_config, match_property) Match.Host, config_parse_net_condition, CONDITION_HOST, offsetof(link_config, conditions) Match.Virtualization, config_parse_net_condition, CONDITION_VIRTUALIZATION, offsetof(link_config, conditions) Match.KernelCommandLine, config_parse_net_condition, CONDITION_KERNEL_COMMAND_LINE, offsetof(link_config, conditions) diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c index 9dc861fc87..9989e6ab65 100644 --- a/src/udev/net/link-config.c +++ b/src/udev/net/link-config.c @@ -51,6 +51,7 @@ static void link_config_free(link_config *link) { strv_free(link->match_driver); strv_free(link->match_type); strv_free(link->match_name); + strv_free(link->match_property); condition_free_list(link->conditions); free(link->description); @@ -161,7 +162,7 @@ int link_load_one(link_config_ctx *ctx, const char *filename) { if (set_isempty(link->match_mac) && strv_isempty(link->match_path) && strv_isempty(link->match_driver) && strv_isempty(link->match_type) && - strv_isempty(link->match_name) && !link->conditions) + strv_isempty(link->match_name) && strv_isempty(link->match_property) && !link->conditions) log_warning("%s: No valid settings found in the [Match] section. " "The file will match all interfaces. " "If that is intended, please add OriginalName=* in the [Match] section.", @@ -241,7 +242,7 @@ int link_config_get(link_config_ctx *ctx, sd_device *device, link_config **ret) LIST_FOREACH(links, link, ctx->links) { if (net_match_config(link->match_mac, link->match_path, link->match_driver, - link->match_type, link->match_name, + link->match_type, link->match_name, link->match_property, device, NULL, NULL)) { if (link->match_name) { unsigned name_assign_type = NET_NAME_UNKNOWN; diff --git a/src/udev/net/link-config.h b/src/udev/net/link-config.h index a45a0e709a..cd99cd54d4 100644 --- a/src/udev/net/link-config.h +++ b/src/udev/net/link-config.h @@ -40,6 +40,7 @@ struct link_config { char **match_driver; char **match_type; char **match_name; + char **match_property; LIST_HEAD(Condition, conditions); char *description; |