From patchwork Thu Jan 12 04:40:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Mendoza-Jonas X-Patchwork-Id: 714227 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tzY3G1nfLz9t0q for ; Thu, 12 Jan 2017 15:40:26 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="QkkA27UP"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3tzY3G0gznzDqP7 for ; Thu, 12 Jan 2017 15:40:26 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="QkkA27UP"; dkim-atps=neutral X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Received: from mendozajonas.com (mendozajonas.com [188.166.185.233]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3tzY385qjvzDqCn for ; Thu, 12 Jan 2017 15:40:20 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="QkkA27UP"; dkim-atps=neutral Received: from skellige.ozlabs.ibm.com (unknown [122.99.82.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: sam@mendozajonas.com) by mendozajonas.com (Postfix) with ESMTPSA id 687A2143F68; Thu, 12 Jan 2017 12:40:14 +0800 (SGT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mendozajonas.com; s=mail; t=1484196015; bh=SaHY/JJuwg5gIA1uBIPMRe4MjT3VIirjhiP9gst0F2w=; h=From:To:Cc:Subject:Date:From; b=QkkA27UPL2jJQXpCVkqG6kFhRouW9XevL08ZZa4aLyL6IND0NfReyx1h3VvUJzBpY YtGbEiQyNRMyQTlON9OHIxVwg7XUEFgjtCcIC3ubIIvDKmMk9RjBO3Twj9bN+Wp//y WIujWbFVuO0cSlZY+S4EDg/9OEAzrnQkfpdPaPjs= From: Samuel Mendoza-Jonas To: petitboot@lists.ozlabs.org Subject: [PATCH 1/2] discover/network: Search by UUID only if available Date: Thu, 12 Jan 2017 15:40:01 +1100 Message-Id: <20170112044002.30422-1-sam@mendozajonas.com> X-Mailer: git-send-email 2.11.0 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Samuel Mendoza-Jonas MIME-Version: 1.0 Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" 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 --- 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;