Skip to content

Commit

Permalink
discover/network: Search by UUID only if available
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
sammj committed Jan 12, 2017
1 parent b406c38 commit 3d7ccc2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion discover/network.c
Expand Up @@ -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;

Expand Down

0 comments on commit 3d7ccc2

Please sign in to comment.