summaryrefslogtreecommitdiffstats
path: root/discover/network.c
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2016-12-23 12:01:26 +1100
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2017-01-12 15:37:09 +1100
commit3d7ccc23cb49d5f8e371dcf6580b78bb78b77046 (patch)
tree83b5e0efd08feff8673ebb90c61e1126185cf64d /discover/network.c
parentb406c38d03dade199ab575ea5992c26a5806a8bd (diff)
downloadpetitboot-3d7ccc23cb49d5f8e371dcf6580b78bb78b77046.zip
petitboot-3d7ccc23cb49d5f8e371dcf6580b78bb78b77046.tar.gz
discover/network: Search by UUID only if available
When registering a new discover device it is possible the device does not have an associated UUID, for example when created via device_handler_process_url(). Fall back to find_interface_by_name() in this case. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'discover/network.c')
-rw-r--r--discover/network.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/discover/network.c b/discover/network.c
index 69223b1..c3cf30a 100644
--- a/discover/network.c
+++ b/discover/network.c
@@ -242,7 +242,10 @@ void network_register_device(struct network *network,
{
struct interface *iface;
- iface = find_interface_by_uuid(network, dev->uuid);
+ if (dev->uuid)
+ iface = find_interface_by_uuid(network, dev->uuid);
+ else
+ iface = find_interface_by_name(network, dev->label);
if (!iface)
return;
OpenPOWER on IntegriCloud