From patchwork Wed Jun 19 10:47:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 252549 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4278A2C029B for ; Wed, 19 Jun 2013 20:47:55 +1000 (EST) Received: from localhost ([::1]:60621 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpFvc-0000ir-Uf for incoming@patchwork.ozlabs.org; Wed, 19 Jun 2013 06:47:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpFvO-0000im-Fu for qemu-devel@nongnu.org; Wed, 19 Jun 2013 06:47:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UpFvL-0000Rj-4k for qemu-devel@nongnu.org; Wed, 19 Jun 2013 06:47:38 -0400 Received: from goliath.siemens.de ([192.35.17.28]:28294) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpFvK-0000RQ-R2 for qemu-devel@nongnu.org; Wed, 19 Jun 2013 06:47:35 -0400 Received: from mail1.siemens.de (localhost [127.0.0.1]) by goliath.siemens.de (8.13.6/8.13.6) with ESMTP id r5JAlW1W031924; Wed, 19 Jun 2013 12:47:32 +0200 Received: from mchn199C.mchp.siemens.de ([139.16.77.133]) by mail1.siemens.de (8.13.6/8.13.6) with ESMTP id r5JAlVmu013572; Wed, 19 Jun 2013 12:47:31 +0200 From: Jan Kiszka To: Anthony Liguori , qemu-devel Date: Wed, 19 Jun 2013 12:47:28 +0200 Message-Id: <68756ba8be2127b6ea30a466af9f78a5c97bc15f.1371638848.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 192.35.17.28 Cc: Bas van Sisseren Subject: [Qemu-devel] [PATCH 1/2] fix -net user checks by reordering checks X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Bas van Sisseren reorder slirp config options. first check the dns-server-address, then check the first-dhcp-address. the original code was comparing the first-dhcp-address with the default dns-server-address, not the configured dns-server-address. Signed-off-by: Bas van Sisseren Signed-off-by: Jan Kiszka --- net/slirp.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/net/slirp.c b/net/slirp.c index b3f35d5..124e953 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -212,19 +212,19 @@ static int net_slirp_init(NetClientState *peer, const char *model, return -1; } - if (vdhcp_start && !inet_aton(vdhcp_start, &dhcp)) { + if (vnameserver && !inet_aton(vnameserver, &dns)) { return -1; } - if ((dhcp.s_addr & mask.s_addr) != net.s_addr || - dhcp.s_addr == host.s_addr || dhcp.s_addr == dns.s_addr) { + if ((dns.s_addr & mask.s_addr) != net.s_addr || + dns.s_addr == host.s_addr) { return -1; } - if (vnameserver && !inet_aton(vnameserver, &dns)) { + if (vdhcp_start && !inet_aton(vdhcp_start, &dhcp)) { return -1; } - if ((dns.s_addr & mask.s_addr) != net.s_addr || - dns.s_addr == host.s_addr) { + if ((dhcp.s_addr & mask.s_addr) != net.s_addr || + dhcp.s_addr == host.s_addr || dhcp.s_addr == dns.s_addr) { return -1; }