summaryrefslogtreecommitdiff
path: root/src/network/networkd-network.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-04-15 14:21:44 +0200
committerTom Gundersen <teg@jklm.no>2014-04-19 18:41:58 +0200
commit505f8da7325591defe5f751f328bd26915267602 (patch)
tree5f4ff2ad396ab7666ac45ed2e1a9f3ff1f13b62b /src/network/networkd-network.c
parentd1ca51b153d7854d49400289ddedc7d493458f71 (diff)
networkd: tie links to rtnl rather than udev
This essentially swaps the roles of rtnl and udev in networkd. After this change libudev is only used for waiting for udev to initialize devices and to get udev-specific information needed for some [Match] attributes. This in particular simplifies the code in containers where udev is not really useful, but also simplifies things and reduces round-trips in the non-container case.
Diffstat (limited to 'src/network/networkd-network.c')
-rw-r--r--src/network/networkd-network.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index bdf71e854e..048017e229 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -184,28 +184,28 @@ void network_free(Network *network) {
free(network);
}
-int network_get(Manager *manager, struct udev_device *device, Network **ret) {
+int network_get(Manager *manager, struct udev_device *device,
+ const char *ifname, const struct ether_addr *address,
+ Network **ret) {
Network *network;
assert(manager);
- assert(device);
assert(ret);
LIST_FOREACH(networks, network, manager->networks) {
if (net_match_config(network->match_mac, network->match_path,
- network->match_driver, network->match_type,
- network->match_name, network->match_host,
- network->match_virt, network->match_kernel,
- network->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)),
- udev_device_get_property_value(device, "ID_NET_DRIVER"),
- udev_device_get_devtype(device),
- udev_device_get_sysname(device))) {
- log_debug("%s: found matching network '%s'",
- udev_device_get_sysname(device),
- network->filename);
+ network->match_driver, network->match_type,
+ network->match_name, network->match_host,
+ network->match_virt, network->match_kernel,
+ network->match_arch,
+ address,
+ udev_device_get_property_value(device, "ID_PATH"),
+ udev_device_get_driver(udev_device_get_parent(device)),
+ udev_device_get_property_value(device, "ID_NET_DRIVER"),
+ udev_device_get_devtype(device),
+ ifname)) {
+ log_debug("%s: found matching network '%s'", ifname,
+ network->filename);
*ret = network;
return 0;
}