diff options
author | Tom Gundersen <teg@jklm.no> | 2015-03-26 21:53:38 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-03-27 16:23:46 +0100 |
commit | af3aa302741b6edb0729925febb5f8bc26721fe3 (patch) | |
tree | 4a028bc2038d90bbd713a4e9982c0065fbc0e13a /src | |
parent | a06c8219a324825c8043cc72508e423b267caab8 (diff) |
network: don't pass NULL to udev_device_get_driver()
Diffstat (limited to 'src')
-rw-r--r-- | src/network/networkd-network.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index 141c36f254..78bbf74bff 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -272,9 +272,24 @@ int network_get(Manager *manager, struct udev_device *device, const char *ifname, const struct ether_addr *address, Network **ret) { Network *network; + struct udev_device *parent; + const char *path, *parent_driver, *driver, *devtype; assert(manager); assert(ret); + assert(device); + + path = udev_device_get_property_value(device, "ID_PATH"); + + parent = udev_device_get_parent(device); + if (parent) + parent_driver = udev_device_get_driver(parent); + else + parent_driver = NULL; + + driver = udev_device_get_property_value(device, "ID_NET_DRIVER"); + + devtype = udev_device_get_devtype(device); LIST_FOREACH(networks, network, manager->networks) { if (net_match_config(network->match_mac, network->match_path, @@ -282,12 +297,8 @@ int network_get(Manager *manager, struct udev_device *device, 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)) { + address, path, parent_driver, driver, + devtype, ifname)) { if (network->match_name) { const char *attr; uint8_t name_assign_type = NET_NAME_UNKNOWN; |