From patchwork Fri Apr 3 14:59:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 2882 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 48v3466hhjz3yBr for ; Fri, 3 Apr 2020 14:59:18 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 48v3453xgrz2Cj; Fri, 3 Apr 2020 14:59:17 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 48v3452ybjz2yj8; Fri, 3 Apr 2020 14:59:17 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 48v3440n7Kz2xfm for ; Fri, 3 Apr 2020 14:59:16 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 48v3431rXhz1Kx; Fri, 3 Apr 2020 14:59:15 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1585925955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=VtsYnQJtvRVYtfKVI0IhHhrEkT1m61ZgNbeGi9rfqEY=; b=9XiRxAiZnf2cbscY7jIrRp3W8+sjtDjlH8hjKLhrjw/v/+b5Ky0F+8wGsVHTg5jf2xXh+O DUgQw9CEyH7QfGAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1585925955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=VtsYnQJtvRVYtfKVI0IhHhrEkT1m61ZgNbeGi9rfqEY=; b=qqI4mH66GMRgDKIxz/v0YzHFW+e1DRIhL5QfP8rr+SPGxq/CxL3sIcO/rBMPy7dO6zAMLL qXRTKbNznxvuu7s/aN14WdM5OarwxryFPCFxvny+bKiWFPBo06MS8X9qK7+lbPA4PkwU2I fcoK0cPUsTEyPPbxzvOy1hrTKpFOlaKkWwnCciMTmMh1175n+QDbAj7ywyCZAIC1HGYhOM EFsNn8Hsd0JdeEIXyljbXIe41tFmliB5kLe1JwUPI7WeoIk7QqSlGyyaF+08dYTbu7i36d 6oTaX5mcpPkS8vs5MrVIJZvbgT2+n+Z1MaW03U29mV27j2jPxBW1NUU8DfbJYQ== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH] IDS: Add GREEN and BLUE addresses to the list of DNS servers. Date: Fri, 3 Apr 2020 16:59:12 +0200 Message-Id: <20200403145912.9808-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Fixes #12349. Signed-off-by: Stefan Schantl Reviewed-by: Peter Müller --- config/cfgroot/ids-functions.pl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/config/cfgroot/ids-functions.pl b/config/cfgroot/ids-functions.pl index 5bc3e77ec..f124b12be 100644 --- a/config/cfgroot/ids-functions.pl +++ b/config/cfgroot/ids-functions.pl @@ -718,13 +718,28 @@ sub generate_dns_servers_file() { # Get the used DNS servers. my @nameservers = &General::get_nameservers(); + # Get network settings. + my %netsettings; + &General::readhash("${General::swroot}/ethernet/settings", \%netsettings); + # Format dns servers declaration. my $line = ""; # Check if the system has configured nameservers. if (@nameservers) { + # Add the GREEN address as DNS servers. + push(@nameservers, $netsettings{'GREEN_ADDRESS'}); + + # Check if a BLUE zone exists. + if ($netsettings{'BLUE_ADDRESS'}) { + # Add the BLUE address to the array of nameservers. + push(@nameservers, $netsettings{'BLUE_ADDRESS'}); + } + + # Generate the line which will be written to the DNS servers file. $line = join(",", @nameservers); } else { + # External net simply contains (any). $line = "\$EXTERNAL_NET"; }