NetBSD Problem Report #58219

From www@netbsd.org  Wed May  1 08:05:29 2024
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 E30C61A9238
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  1 May 2024 08:05:28 +0000 (UTC)
Message-Id: <20240501080527.983EA1A923A@mollari.NetBSD.org>
Date: Wed,  1 May 2024 08:05:27 +0000 (UTC)
From: nia@pkgsrc.org
Reply-To: nia@pkgsrc.org
To: gnats-bugs@NetBSD.org
Subject: sysinst should check if IPv6 is available and set ip6addrctl_policy=ipv4_prefer if no
X-Send-Pr-Version: www-1.0

>Number:         58219
>Category:       install
>Synopsis:       sysinst should check if IPv6 is available and set ip6addrctl_policy=ipv4_prefer if no
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    install-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 01 08:10:00 +0000 2024
>Last-Modified:  Sat May 04 11:35:01 +0000 2024
>Originator:     nia
>Release:        any netbsd release on QEMU
>Organization:
The AttemptingToConnectBSD Foundation
>Environment:
>Description:
Most virtual machines are buggy and report a fake ipv6 route.

NetBSD's tools like ftp will hang for far too long attempting to reach an ipv6 address.
>How-To-Repeat:
install netbsd in qemu, use ftp
>Fix:
set

ip6addrctl=YES
ip6addrctl_policy=ipv4_prefer

in rc.conf when ipv6 is unavailable.

>Audit-Trail:
From: Sunil Nimmagadda <sunil@nimmagadda.net>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: install/58219: sysinst should check if IPv6 is available and
 set ip6addrctl_policy=ipv4_prefer if no
Date: Thu, 02 May 2024 11:32:15 +0530

 nia@pkgsrc.org writes:

 >>Number:         58219
 >>Category:       install
 >>Synopsis:       sysinst should check if IPv6 is available and set ip6addrctl_policy=ipv4_prefer if no
 >>Confidential:   no
 >>Severity:       serious
 >>Priority:       medium
 >>Responsible:    install-manager
 >>State:          open
 >>Class:          sw-bug
 >>Submitter-Id:   net
 >>Arrival-Date:   Wed May 01 08:10:00 +0000 2024
 >>Originator:     nia
 >>Release:        any netbsd release on QEMU
 >>Organization:
 > The AttemptingToConnectBSD Foundation
 >>Environment:
 >>Description:
 > Most virtual machines are buggy and report a fake ipv6 route.
 >
 > NetBSD's tools like ftp will hang for far too long attempting to reach an ipv6 address.
 >>How-To-Repeat:
 > install netbsd in qemu, use ftp
 >>Fix:
 > set
 >
 > ip6addrctl=YES
 > ip6addrctl_policy=ipv4_prefer
 >
 > in rc.conf when ipv6 is unavailable.

 This diff seems to fix the issue for me. Testing on amd64.

 -----
 Prefer Ipv4 if no working Ipv6 is detected during net configuration.

 Fixes install/58219.

 diff --git a/usr.sbin/sysinst/net.c b/usr.sbin/sysinst/net.c
 --- a/usr.sbin/sysinst/net.c
 +++ b/usr.sbin/sysinst/net.c
 @@ -1198,6 +1198,11 @@
  		add_rc_conf("wpa_supplicant_flags=\"-B -s -i %s -D bsd -c /etc/wpa_supplicant.conf\"\n", net_dev);
  	}

 +	if (!have_working_ipv6()) {
 +		add_rc_conf("ip6addrctl=YES");
 +		add_rc_conf("ip6addrctl_policy=ipv4_prefer");
 +	}
 +
  	if (ifconf)
  		fclose(ifconf);


From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: install/58219: sysinst should check if IPv6 is available and set
 ip6addrctl_policy=ipv4_prefer if no
Date: Thu, 2 May 2024 11:31:52 +0200

 I disagree with this aproach. In general it is not a good idea to hardcode
 lots of magic in sysinst to work around clearly broken local setups.

 We also should not hardcode such add-hoc decisions made at install time
 for future runtime of the installed machine.

 I understand the original request. This often hits at "free" wifi
 services e.g. in hotels. My own usual answer is that ftp(1) (like most
 user applications) should properly do happy-eyeball, to which  the
 typical response is: fix your IPv6 setup. 

 In pure IPv4 setups this is no issue, only if some misconfiugred
 router provides a non-working IPv6 default route we get the annoying
 60s connect timeout for IPv6 tries.

 Martin

From: Christoph Badura <bad@bsd.de>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: install/58219: sysinst should check if IPv6 is available and
 set ip6addrctl_policy=ipv4_prefer if no
Date: Sat, 4 May 2024 13:33:56 +0200

 I'm also against automagically (and silently) fixing perceived network
 problems.  And worse, making the changes silently permanent.

 Why not, instead, tell users that they can disable IP protocols with
 qemu's "-nic user,.." option and point them to TFM.

 The very first example at
 https://www.qemu.org/docs/master/system/invocation.html#sec-005finvocation
 shows how to disable IPv6.

 --chris

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-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.