From nobody Wed Nov 12 08:37:45 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1569780880; cv=none; d=zoho.com; s=zohoarc; b=a8GPDE4YVxUJHPL1zxTc+T/w+NYtAYQAVVkMpg3SNiyqCGbIMqR1/1opMGTnN4AJWOYvd4naj4hsejiIV+3eTPEH0shBFjVvaKyRUt5kOVLQYLSXuQOV5eOb4AQUhEUu26hFWy4P504Xx9mzDNxBZU7UU99BwwUo6NZ0B4ZE7Hc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569780880; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=uQjqy+5+ZFhxG79CoKsbophLZvCSRTapXudMXwWwIS8=; b=NrqX6htAoAZ0VbrHY+QF2q/H9koBHJSQ/+ALSoUBNwWAS429ZUsqiiYYnqxtX1qu7sOvole8DUN7EuPlKNsVzH7b0gGrWw3oT5sTWkAzu5LmuY8Wewenu4utfNoRbAWxr2K+ZgN2oZ0IhO7mV0T+OhOfgrpuCKThTRCHM+SQZXY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1569780880030522.9338706497949; Sun, 29 Sep 2019 11:14:40 -0700 (PDT) Received: from localhost ([::1]:41466 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iEdiQ-0004Tb-VY for importer@patchew.org; Sun, 29 Sep 2019 14:14:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37969) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iEdhC-0003XK-Rr for qemu-devel@nongnu.org; Sun, 29 Sep 2019 14:13:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iEdhB-00014M-B1 for qemu-devel@nongnu.org; Sun, 29 Sep 2019 14:13:22 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:35522) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iEdhB-00012O-4N for qemu-devel@nongnu.org; Sun, 29 Sep 2019 14:13:21 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 510EFA7AB0; Sun, 29 Sep 2019 20:13:12 +0200 (CEST) Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jjT148heVnmF; Sun, 29 Sep 2019 20:13:11 +0200 (CEST) Received: from function (unknown [109.190.253.14]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 713A3A7AD0; Sun, 29 Sep 2019 20:13:10 +0200 (CEST) Received: from samy by function with local (Exim 4.92.2) (envelope-from ) id 1iEdgy-0005Ci-K1; Sun, 29 Sep 2019 20:13:08 +0200 X-Virus-Scanned: Debian amavisd-new at aquilenet.fr From: Samuel Thibault To: qemu-devel@nongnu.org, jasowang@redhat.com Subject: [PATCH] slirp: Allow non-local DNS address when restrict is off Date: Sun, 29 Sep 2019 20:13:03 +0200 Message-Id: <20190929181303.19960-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 185.233.100.1 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Samuel Thibault Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" This can be used to set a DNS server to be used by the guest which is different from the one configured on the host. This fixes LP 1010484. Signed-off-by: Samuel Thibault Reviewed-by: Marc-Andr=C3=A9 Lureau --- net/slirp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/slirp.c b/net/slirp.c index f42f496641..4d158b0542 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -456,7 +456,7 @@ static int net_slirp_init(NetClientState *peer, const c= har *model, error_setg(errp, "Failed to parse DNS"); return -1; } - if ((dns.s_addr & mask.s_addr) !=3D net.s_addr) { + if (restricted && (dns.s_addr & mask.s_addr) !=3D net.s_addr) { error_setg(errp, "DNS doesn't belong to network"); return -1; } --=20 2.23.0