NetBSD Problem Report #57244

From www@netbsd.org  Sat Feb 25 20:41:08 2023
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id DA2DC1A9239
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 25 Feb 2023 20:41:08 +0000 (UTC)
Message-Id: <20230225204107.2D0621A923B@mollari.NetBSD.org>
Date: Sat, 25 Feb 2023 20:41:07 +0000 (UTC)
From: tgl@sss.pgh.pa.us
Reply-To: tgl@sss.pgh.pa.us
To: gnats-bugs@NetBSD.org
Subject: sysinst ignores manually-supplied DNS server address
X-Send-Pr-Version: www-1.0

>Number:         57244
>Category:       install
>Synopsis:       sysinst ignores manually-supplied DNS server address
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    install-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 25 20:45:00 +0000 2023
>Last-Modified:  Mon Feb 27 11:30:01 +0000 2023
>Originator:     Tom Lane
>Release:        10.0_BETA 202302240730Z snapshot
>Organization:
>Environment:
NetBSD sss2.sss.pgh.pa.us 10.0_BETA NetBSD 10.0_BETA (SD0) #0: Fri Feb 24 15:31:21 EST 2023  tgl@nuc1.sss.pgh.pa.us:/home/tgl/netbsd-10-202302240730Z/obj.hppa/sys/arch/hppa/compile/SD0 hppa
>Description:
If I allow sysinst's "Configure network" dialog to do autoconfiguration, and then manually override its choice of DNS server address, it ignores the manual entry when setting up its own /etc/resolv.conf, so that later sysinst operations such as fetching distribution files from an NFS server may be unable to resolve DNS names as expected.

I've only encountered this in the context of doing the "b) Upgrade NetBSD" option, which won't attempt to modify the target installation's /etc/resolv.conf.  So I'm not sure whether the wrong server address would also get written into that during a normal install.  If it does write the correct address there then many people wouldn't notice the issue.

This is a fairly new bug --- I last did this type of thing with the 10.0 202212262100Z snapshot, and it behaved correctly then.

Also, there may be an IPv4 vs IPv6 issue here: autoconfiguration is seizing on an IPv6 DNS server address, which I think is being offered (against my wishes) by my Verizon router, and ignoring the IPv4 DNS server addresses offered by my DHCP server.  Then when I manually put in the IPv4 address I want it to use, it's ignoring that in favor of the IPv6 address.  This results in a failure since the Verizon router knows nothing of the local machine I want to do an NFS installation from.
>How-To-Repeat:
See above.  You may need a mixed IPv4/v6 environment.  I got to the "Configure network" dialog from the fetch-distribution-files-from-NFS dialog, but I doubt that the exact path matters too much.  After mount complained that it can't get an IP address for the given NFS host name, I control-Z'd sysinst and looked at /etc/resolv.conf to see that it contained the unwanted IPv6 address and not the wanted IPv4 one.  (Thanks to Martin Husemann for that debugging suggestion.)
>Fix:

>Audit-Trail:
From: Tom Lane <tgl@sss.pgh.pa.us>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: install/57244: sysinst ignores manually-supplied DNS server address
Date: Sat, 25 Feb 2023 15:58:43 -0500

 I forgot to mention one odd point: in the final step of the "Configure
 network" dialog, where it shows you the settings it intends to use
 and asks if they're okay, it does show the manually-entered DNS server
 address ... which it then proceeds to not use.  This contributed
 greatly to my confusion over where the problem was.

 			regards, tom lane

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: install/57244: sysinst ignores manually-supplied DNS server
 address
Date: Sun, 26 Feb 2023 12:00:28 +0100

 Can you please provide the full /etc/resolv.conf that is created in your
 environment with the nameserver IP? Especially does it have a comment
 like:

 	# Generated by resolvconf

 at the first line?

 There may be a timing issue with dhcpcd in the background overwriting the
 sysinst generated file.

 Martin

From: Tom Lane <tgl@sss.pgh.pa.us>
To: gnats-bugs@netbsd.org, Martin Husemann <martin@duskware.de>
Cc: install-manager@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: install/57244: sysinst ignores manually-supplied DNS server address
Date: Sun, 26 Feb 2023 11:42:04 -0500

 Martin Husemann <martin@duskware.de> writes:
 >  Can you please provide the full /etc/resolv.conf that is created in your
 >  environment with the nameserver IP?

 What I saw when interrupting sysinst was

 # cat /etc/resolv.conf
 # Generated by dhcpcd from tlp0.dhcp, tlp0.dhcp6, tlp0.ra
 # /etc/resolv.conf.head can replace this line
 domain sss.pgh.pa.us
 nameserver 2600:4041:2eb:1c00::1
 # /etc/resolv/conf.tail can replace this line

 (manually transcribed from screen photo, there might be typos)

 What is in the hppa machine's normal /etc/resolv.conf is

 ;
 ; BIND data file
 ; Created by NetBSD sysinst on Sat May  7 18:29:16 2022
 ;
 search sss.pgh.pa.us
 nameserver 192.168.1.8
 nameserver 192.168.1.14

 I'm not sure to what extent I may have hand-edited that,
 though.  The file date is a few days later than May 7,
 so I changed it at least a bit.  Perhaps I added the
 second nameserver manually --- I don't recall ever
 trying to enter more than one nameserver in sysinst.

 I have a dhcpv4 server that is advertising 192.168.1.8
 and 192.168.1.14 as DNS servers.  Also, I have found
 no way to stop my Verizon router from advertising itself
 as a DNS server.  It does have DHCP turned off so I'm not
 quite sure what protocol it's using to do so, but some of
 my gear reports seeing 192.168.1.2 (the Verizon box's
 inside IP) as an autoconfigured DNS server, and the
 2600... IPv6 addresss shown above is the Verizon box's
 inside IPv6 address.

 Anyway, when I first ran "Configure network" and let it
 autoconfigure, it asked me for host name and domain anyway,
 and what I saw after the autoconfigure was the manually
 entered domain and host name, then the above 2600... IPv6
 address for nameserver, host IP 192.168.1.3 which is correct
 (but I think it must have gotten that from the kernel loader
 bootp protocol, as my DHCP server isn't set to allocate that),
 IPv4 gateway fe80::3ebd... which I think is one of my Verizon
 box's link-local addresses (this choice seems quite strange),
 and "IPv6 autoconf" being another 2600:4041:... address which
 it must have gotten by delegation from the Verizon box.

 In short it seems to have completely ignored the IPv4 DHCP
 server in favor of the IPv6 info.

 I then manually overrode the nameserver and IPv4 gateway addresses
 but left the "IPv6 autoconf" entry alone; perhaps that was
 a mistake?

 Anyway, ifconfig within the sysinst environment showed the
 192.168.1.3 address as assigned to tlp0, along with both
 the "autoconf" IPv6 address and another fe80::... address.

 >  There may be a timing issue with dhcpcd in the background overwriting the
 >  sysinst generated file.

 Looks like a good bet :-(.  Why is dhcpcd running at all,
 though?

 			regards, tom lane

From: Martin Husemann <martin@duskware.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: gnats-bugs@netbsd.org, install-manager@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: install/57244: sysinst ignores manually-supplied DNS server
 address
Date: Mon, 27 Feb 2023 12:25:27 +0100

 On Sun, Feb 26, 2023 at 11:42:04AM -0500, Tom Lane wrote:
 > >  There may be a timing issue with dhcpcd in the background overwriting the
 > >  sysinst generated file.
 > 
 > Looks like a good bet :-(.  Why is dhcpcd running at all,
 > though?

 That is a good question, it used to be a one-off run that did all the
 autoconfiguration stuff, but seems to now fork a background instance 
 (sometimes?) - maybe we need to adjust the invocation from sysinst to
 prevent that.

 Martin

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.