[PATCH 1/2] discover/network: Search by UUID only if available
Samuel Mendoza-Jonas
sam at mendozajonas.com
Thu Jan 12 15:40:01 AEDT 2017
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 at mendozajonas.com>
---
discover/network.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
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;
--
2.11.0
More information about the Petitboot
mailing list