udev/net: introduce "struct Link" to store link attributes

This commit is contained in:
Yu Watanabe
2021-11-26 21:06:24 +09:00
parent 418c02c3f1
commit 613701a4e8
4 changed files with 230 additions and 209 deletions
+3 -10
View File
@@ -134,21 +134,14 @@ int net_match_config(
_cleanup_free_ char *iftype_str = NULL;
const char *path = NULL;
int r;
assert(match);
r = net_get_type_string(device, iftype, &iftype_str);
if (r == -ENOMEM)
return r;
if (net_get_type_string(device, iftype, &iftype_str) == -ENOMEM)
return -ENOMEM;
if (device) {
if (device)
(void) sd_device_get_property_value(device, "ID_PATH", &path);
if (!driver)
(void) sd_device_get_property_value(device, "ID_NET_DRIVER", &driver);
if (!ifname)
(void) sd_device_get_sysname(device, &ifname);
}
if (match->hw_addr && (!hw_addr || !set_contains(match->hw_addr, hw_addr)))
return false;