From gordont@hobbes.melthusia.org  Sun Jan  7 15:34:17 2001
Return-Path: <gordont@hobbes.melthusia.org>
Received: from hobbes.melthusia.org (dt035n37.san.rr.com [24.30.140.55])
	by hub.freebsd.org (Postfix) with ESMTP id E810437B698
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  7 Jan 2001 15:34:16 -0800 (PST)
Received: (from gordont@localhost)
	by hobbes.melthusia.org (8.11.1/8.11.1) id f07NYAA01394;
	Sun, 7 Jan 2001 15:34:10 -0800 (PST)
	(envelope-from gordont)
Message-Id: <200101072334.f07NYAA01394@hobbes.melthusia.org>
Date: Sun, 7 Jan 2001 15:34:10 -0800 (PST)
From: Gordon Tetlow <gordont@bluemtn.net>
Sender: gordont@hobbes.melthusia.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: Options tryDHCP and tryRTSOL in sysinstall's install.cfg confusing
X-Send-Pr-Version: 3.2

>Number:         24136
>Category:       bin
>Synopsis:       sysinstall's install.cfg tryRTSOL and tryDHCP don't work
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 07 15:40:02 PST 2001
>Closed-Date:    Fri Aug 31 12:57:39 PDT 2001
>Last-Modified:  Fri Aug 31 12:59:51 PDT 2001
>Originator:     Gordon Tetlow
>Release:        FreeBSD 4.2-STABLE i386
>Organization:
Blue Mountain Arts
>Environment:

N/A

>Description:

When creating a install.cfg for an unattended installation, I specified
tryRTSOL=NO so it wouldn't prompt me for IPv6 configuration of my
network interfaces. Unfortunately, it still prompted me for it. From
looking at the code, tryDHCP=NO would produce the same result.

>How-To-Repeat:

Try an unattended install specifying tryRTSOL=NO. It will still prompt you
asking if you want to Configure IPv6 for your network interface.

>Fix:

Quick work around:
	Use tryRTSOL=ASDF or some other nonsensical value

Patch:
	I think this should do it. I wasn't able to rebuild it to check
	to see if it works, but the logic is there.

diff -uNr sysinstall.orig/install.c sysinstall/install.c
--- sysinstall.orig/install.c	Sun Jan  7 14:48:22 2001
+++ sysinstall/install.c	Sun Jan  7 14:48:52 2001
@@ -1060,8 +1060,8 @@
     variable_set2(VAR_TAPE_BLOCKSIZE,		DEFAULT_TAPE_BLOCKSIZE, 0);
     variable_set2(VAR_INSTALL_ROOT,		"/", 0);
     variable_set2(VAR_INSTALL_CFG,		"install.cfg", 0);
-    variable_set2(VAR_TRY_DHCP,			"NO", 0);	/* For now */
-    variable_set2(VAR_TRY_RTSOL,		"NO", 0);	/* For now */
+    variable_set2(VAR_TRY_DHCP,			"UNSET", 0);	/* For now */
+    variable_set2(VAR_TRY_RTSOL,		"UNSET", 0);	/* For now */
     cp = getenv("EDITOR");
     if (!cp)
 	cp = "/usr/bin/ee";
diff -uNr sysinstall.orig/tcpip.c sysinstall/tcpip.c
--- sysinstall.orig/tcpip.c	Sun Jan  7 14:48:22 2001
+++ sysinstall/tcpip.c	Sun Jan  7 14:50:02 2001
@@ -268,7 +268,7 @@
 
 	/* Try a RTSOL scan if such behavior is desired */
 	if (!variable_cmp(VAR_TRY_RTSOL, "YES") || 
-	    ((!variable_cmp(VAR_TRY_RTSOL, "NO")) && (!msgNoYes("Do you want to try IPv6 configuration of the interface?")))) {
+	    ((!variable_cmp(VAR_TRY_RTSOL, "UNSET")) && (!msgNoYes("Do you want to try IPv6 configuration of the interface?")))) {
 	    int i;
 	    int len;
 
@@ -294,7 +294,7 @@
 
 	/* First try a DHCP scan if such behavior is desired */
 	if (!variable_cmp(VAR_TRY_DHCP, "YES") || 
-	    ((!variable_cmp(VAR_TRY_DHCP, "NO")) && (!msgNoYes("Do you want to try DHCP configuration of the interface?")))) {
+	    ((!variable_cmp(VAR_TRY_DHCP, "UNSET")) && (!msgNoYes("Do you want to try DHCP configuration of the interface?")))) {
 	    Mkdir("/var/db");
 	    Mkdir("/var/run");
 	    Mkdir("/tmp");

>Release-Note:
>Audit-Trail:

From: Glenn Trewitt <glenn@trewitt.org>
To: freebsd-gnats-submit@FreeBSD.org, gordont@bluemtn.net
Cc:  
Subject: Re: bin/24136: sysinstall's install.cfg tryRTSOL and tryDHCP don't work
Date: Fri, 01 Jun 2001 17:51:57 -0700

 I just ran across the same bug.  I think that I found the more basic
 problem.  In tcpip.c, the code that tests the value of tryDHCP (and
 tryRTSOL) has the test backwards when checking for the "NO" value.  In
 the code:
         if (!variable_cmp(VAR_TRY_DHCP, "YES") ||
             ((!variable_cmp(VAR_TRY_DHCP, "NO")) && (!msgNoYes("Do you
 want to try DHCP configuration of the interface?")))) {
 
 should be
         if (!variable_cmp(VAR_TRY_DHCP, "YES") ||
             ((variable_cmp(VAR_TRY_DHCP, "NO")) && (!msgNoYes("Do you
 want to try DHCP configuration of the interface?")))) {
 
 I think that this addresses the underlying problem.  (This also explains
 why setting tryDHCP to anything besides "YES" or "NO" has the effect
 expected for tryDHCP=NO.
 
     - Glenn Trewitt
 
 
State-Changed-From-To: open->closed 
State-Changed-By: jkh 
State-Changed-When: Fri Aug 31 12:57:39 PDT 2001 
State-Changed-Why:  
Related bug fixed. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=24136 
>Unformatted:
