From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a29Si-00042t-QL for qemu-devel@nongnu.org; Thu, 26 Nov 2015 22:12:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a29Sh-0002ug-U1 for qemu-devel@nongnu.org; Thu, 26 Nov 2015 22:12:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53339) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a29Sh-0002ub-P8 for qemu-devel@nongnu.org; Thu, 26 Nov 2015 22:12:39 -0500 From: Jason Wang Date: Fri, 27 Nov 2015 11:12:22 +0800 Message-Id: <1448593943-6415-3-git-send-email-jasowang@redhat.com> In-Reply-To: <1448593943-6415-1-git-send-email-jasowang@redhat.com> References: <1448593943-6415-1-git-send-email-jasowang@redhat.com> Subject: [Qemu-devel] [PULL for-2.5 2/3] tap-win32: skip unexpected nodes during registry enumeration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, peter.maydell@linaro.org Cc: Jason Wang , Andrew Baumann From: Andrew Baumann In order to find a named tap device, get_device_guid() enumerates children of HKLM\SYSTEM\CCS\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318} (aka NETWORK_CONNECTIONS_KEY). For each child, it then looks for a "Connection" subkey, but if this key doesn't exist, it aborts the entire search. This was observed to fail on at least one Windows 10 machine, where there is an additional child of NETWORK_CONNECTIONS_KEY (named "Descriptions"). Since registry enumeration doesn't guarantee any particular sort order, we should continue to search for matching children rather than aborting the search. Signed-off-by: Andrew Baumann Reviewed-by: Stefan Weil Signed-off-by: Jason Wang --- net/tap-win32.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/tap-win32.c b/net/tap-win32.c index 4e2fa55..5e5d6db 100644 --- a/net/tap-win32.c +++ b/net/tap-win32.c @@ -356,7 +356,8 @@ static int get_device_guid( &len); if (status != ERROR_SUCCESS || name_type != REG_SZ) { - return -1; + ++i; + continue; } else { if (is_tap_win32_dev(enum_name)) { -- 2.5.0