.network/.netdev/.link: allow to match on architecture

This commit is contained in:
Tom Gundersen
2014-02-21 16:05:02 +01:00
parent 7a243b2204
commit edbb03e95a
12 changed files with 53 additions and 12 deletions
+1
View File
@@ -23,6 +23,7 @@ Match.Type, config_parse_string, 0,
Match.Host, config_parse_net_condition, CONDITION_HOST, offsetof(link_config, match_host)
Match.Virtualization, config_parse_net_condition, CONDITION_VIRTUALIZATION, offsetof(link_config, match_virt)
Match.KernelCommandLine, config_parse_net_condition, CONDITION_KERNEL_COMMAND_LINE, offsetof(link_config, match_kernel)
Match.Architecture, config_parse_net_condition, CONDITION_ARCHITECTURE, offsetof(link_config, match_arch)
Link.Description, config_parse_string, 0, offsetof(link_config, description)
Link.MACAddressPolicy, config_parse_mac_policy, 0, offsetof(link_config, mac_policy)
Link.MACAddress, config_parse_hwaddr, 0, offsetof(link_config, mac)
+3 -3
View File
@@ -240,9 +240,9 @@ int link_config_get(link_config_ctx *ctx, struct udev_device *device, link_confi
LIST_FOREACH(links, link, ctx->links) {
if (net_match_config(link->match_mac, link->match_path,
link->match_driver, link->match_type, NULL,
link->match_host, link->match_virt, link->match_kernel,
if (net_match_config(link->match_mac, link->match_path, link->match_driver,
link->match_type, NULL, link->match_host,
link->match_virt, link->match_kernel, link->match_arch,
udev_device_get_sysattr_value(device, "address"),
udev_device_get_property_value(device, "ID_PATH"),
udev_device_get_driver(udev_device_get_parent(device)),
+1
View File
@@ -58,6 +58,7 @@ struct link_config {
Condition *match_host;
Condition *match_virt;
Condition *match_kernel;
Condition *match_arch;
char *description;
struct ether_addr *mac;