From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=fail (p=quarantine dis=none) header.from=redhat.com Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id CE5D85A026E for ; Fri, 04 Dec 2026 23:15:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796422536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3o0g9rscLnMNGMSkp2kCX/P0igkQiFeS6uSDCqmijIw=; b=MI+4wLYR/2gTB517zZb/Zc07sGLU4eIC7afPvZB3xfvgZ1yZeWKOnbEbjteJHf03LdgQbT W7wrd/c+m7jSnN19QMsDupE5UiIZdnZZIAm/kxLEoUvTLZUlXg0KL6r1q23XIQdhI4bTmb H6FOxj1PCVTITHfdutNPBt/IKnuc4nE= X-MC-Rep: binary re single Received: from mail-dl1-f70.google.com (mail-dl1-f70.google.com [74.125.82.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-127-0yR1QTdlMja7zYlNBIcyLw-1; Fri, 4 Dec 2026 22:15:30 +0000 X-MC-Unique: 0yR1QTdlMja7zYlNBIcyLw-1 X-Mimecast-MFC-AGG-ID: 0yR1QTdlMja7zYlNBIcyLw_1796422530 Received: by mail-dl1-f70.google.com with SMTP id a92af1059eb24-1b5d6036854so4143071c88.1 for ; Fri, 04 Dec 2026 14:15:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796422530; x=1797027330; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:re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ZCrR6yq7nSFVUg +D0rHL+PTfyCiI0jf5HS/fA14lXRn3hgBRp6PvtKUFlyqw2Ju00cp+WukjNEKLEgN0waUxZze/W q4RpV3F4c/zvXCCyZ21KmGpfjDUv8gbzVf8FZQJi4= X-Received: by 2002:a05:701b:250d:b0:1b5:dd94:6adc with SMTP id a92af1059eb24-1b5dd94735amr833952c88.36.1796422529542; Fri, 04 Dec 2026 14:15:29 -0800 (PST) X-Received: by 2002:a05:701b:250d:b0:1b5:dd94:6adc with SMTP id a92af1059eb24-1b5dd94735amr833935c88.36.1796422529038; Fri, 04 Dec 2026 14:15:29 -0800 (PST) Received: from [192.168.2.15] (lnsm6-montreal02-142-122-43-105.internet.virginmobile.ca. [142.122.43.105]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b5d63d0e64sm10209171c88.2.2026.12.04.14.15.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Dec 2026 14:15:28 -0800 (PST) Message-ID: Date: Fri, 4 Dec 2026 17:15:24 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/3] conf: Forget host nameserver once it's removed from resolv.conf To: Aditya Merchant , passt-dev@passt.top References: <20261204073119.31027-1-adityamerchant08@gmail.com> <20261204073119.31027-3-adityamerchant08@gmail.com> From: Jon Maloy In-Reply-To: <20261204073119.31027-3-adityamerchant08@gmail.com> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Roc7pjiF5fJ9gG0n4F73rLBWQZhtjLvZIAcClqZszxo_1796422530 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID-Hash: 567GZW3DDOAJDOO7XCBUUTU2ELAG5UOS X-Message-ID-Hash: 567GZW3DDOAJDOO7XCBUUTU2ELAG5UOS X-MailFrom: jmaloy@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Stefano Brivio , David Gibson , Paul Holzinger , Laurent Vivier X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 2026-12-04 02:31, Aditya Merchant wrote: > When we follow changes to resolv.conf, and it doesn't list a nameserver > for an IP version anymore, conf_resolv_update() keeps the one we had > before, and we keep redirecting DNS queries to it. > > That's not what we do at start-up, where get_dns() leaves .dns_host > unspecified if there's no nameserver for that IP version, and it's > probably not what users expect either: a nameserver might have been > removed for a reason. Clear .dns_host in that case, so that we stop > redirecting DNS queries for that IP version, until a nameserver is > listed again. The logic looks right to me. One thing that might be worth spelling out, though: clearing .dns_host doesn't make queries to the --dns-forward address fail, it just stops redirecting them, so they go through nat_outbound() like any other packet. If that address is the --map-host-loopback one, as we set it up by default when the host uses a local resolver, they now go to the host's 127.0.0.1:53. If we have an explicit --dns-forward address, they're sent to that address as such, and will usually time out. This is consistent with starting without a nameserver, but it is actually a visible change for a running instance. Maybe this should be mentioned in the commit message? > > Extend the dns_host_follow test to check this. As that takes a few more > steps, keep pasta running until a file shows up, instead of for a fixed > time, which could end before the last step. > > Suggested-by: Stefano Brivio > Link: https://archives.passt.top/passt-dev/20261130013439.0a40738a@elisabeth/ > Signed-off-by: Aditya Merchant > --- > conf.c | 14 ++++++++++++++ [...] > > passt unshare -rUm > passt mkdir -p __DIR__/upper __DIR__/work > passt mount -t overlay -o lowerdir=/etc,upperdir=__DIR__/upper,workdir=__DIR__/work none /etc > passt echo "nameserver 192.0.2.1" > /etc/r && mv /etc/r /etc/resolv.conf > -passt ./pasta -d -l __LOG_FILE__ --dns-forward 192.0.2.53 -- sleep 3 2>/dev/null & > +passt ./pasta -d -l __LOG_FILE__ --dns-forward 192.0.2.53 -- sh -c 'while [ ! -e __DONE__ ]; do sleep 0.1; done' 2>/dev/null & Clearly better than the fixed sleep. > sleep 1 > passt echo "nameserver 192.0.2.2" > /etc/r && mv /etc/r /etc/resolv.conf > sleep 1 > check grep -q "new host nameserver 192.0.2.2" __LOG_FILE__ > -passt wait > + > +test Host nameserver removed from resolv.conf is forgotten > +passt echo "nameserver 2001:db8::1" > /etc/r && mv /etc/r /etc/resolv.conf > +sleep 1 > +passt touch __DONE__ && wait > +check grep -q "removed nameserver 192.0.2.2" __LOG_FILE__ > passt umount /etc > passt exit Reviewed-by: Jon Maloy