From lulf@studby.ntnu.no  Fri Feb 10 18:46:12 2006
Return-Path: <lulf@studby.ntnu.no>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 683CD16A420
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 10 Feb 2006 18:46:12 +0000 (GMT)
	(envelope-from lulf@studby.ntnu.no)
Received: from royk.itea.ntnu.no (royk.itea.ntnu.no [129.241.190.230])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 7B7FF43D53
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 10 Feb 2006 18:46:07 +0000 (GMT)
	(envelope-from lulf@studby.ntnu.no)
Received: from localhost (localhost [127.0.0.1])
	by royk.itea.ntnu.no (Postfix) with ESMTP id A974F66D41
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 10 Feb 2006 19:46:05 +0100 (CET)
Received: from studby.ntnu.no (m062g.studby.ntnu.no [129.241.134.62])
	by royk.itea.ntnu.no (Postfix) with ESMTP
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 10 Feb 2006 19:46:05 +0100 (CET)
Received: by studby.ntnu.no (Postfix, from userid 1001)
	id E261722887; Fri, 10 Feb 2006 19:46:08 +0100 (CET)
Message-Id: <20060210184608.E261722887@studby.ntnu.no>
Date: Fri, 10 Feb 2006 19:46:08 +0100 (CET)
From: Ulf Lilleengen <lulf@stud.ntnu.no>
Reply-To: Ulf Lilleengen <lulf@stud.ntnu.no>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] 6.1-BETA1 DHCP config error
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         93145
>Category:       bin
>Synopsis:       [sysinstall] [patch] 6.1-BETA1 DHCP config error
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-qa
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 10 18:50:02 GMT 2006
>Closed-Date:    Sun Feb 12 23:49:21 GMT 2006
>Last-Modified:  Sun Feb 12 23:49:21 GMT 2006
>Originator:     Ulf Lilleengen
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD vimes.studby.ntnu.no 7.0-CURRENT FreeBSD 7.0-CURRENT #4: Wed Jan 25 21:16:02 CET 2006 root@vimes.studby.ntnu.no:/usr/obj/usr/src/sys/VIMES i386


	
>Description:
	When i try to install 6.1-BETA1 and choose to use DHCP to configure my
	rl0 interface, i get an error saying "ifconfig: DHCP: bad value" coming
	from the installer trying to run ifconfig rl0 DHCP.

	I looked at the code in network.c in sysinstall, and found a difference
	between CURRENT and BETA1, which was an strstr check being changed.
	Patch added below.
	
>How-To-Repeat:
	Try install 6.1-BETA1 and configure network interface with DHCP
	
>Fix:

	

--- sysinstall_dhcpconfig.diff begins here ---
Index: network.c
===================================================================
RCS file: /home/cvs/ncvs/src/usr.sbin/sysinstall/network.c,v
retrieving revision 1.51
diff -u -r1.51 network.c
--- network.c	1 Nov 2002 02:05:05 -0000	1.51
+++ network.c	10 Feb 2006 18:37:24 -0000
@@ -126,7 +126,7 @@
     snprintf(ifconfig, 255, "%s%s", VAR_IFCONFIG, dev->name);
     cp = variable_get(ifconfig);
     if (cp) {
-	if (strcmp(cp, "DHCP")) {
+	if (strcmp(cp, "DHCP") == NULL) {
 	    msgDebug("ifconfig %s %s\n", dev->name, cp);
 	    i = vsystem("ifconfig %s %s", dev->name, cp);
 	    if (i) {
--- sysinstall_dhcpconfig.diff ends here ---


>Release-Note:
>Audit-Trail:

From: Ulf Lilleengen <lulf@stud.ntnu.no>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/93145: [PATCH] 6.1-BETA1 DHCP config error
Date: Fri, 10 Feb 2006 19:57:18 +0100

 --pWyiEgJYm5f9v55/
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 On fre, feb 10, 2006 at 07:46:08 +0100, Ulf Lilleengen wrote:
 >=20
 > >Number:         93145
 > >Category:       bin
 > >Synopsis:       [PATCH] 6.1-BETA1 DHCP config error
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       medium
 > >Responsible:    freebsd-bugs
 > >State:          open
 > >Quarter:       =20
 > >Keywords:      =20
 > >Date-Required:
 > >Class:          sw-bug
 > >Submitter-Id:   current-users
 > >Arrival-Date:   Fri Feb 10 18:50:02 GMT 2006
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Ulf Lilleengen
 > >Release:        FreeBSD 7.0-CURRENT i386
 > >Organization:
 > >Environment:
 > System: FreeBSD vimes.studby.ntnu.no 7.0-CURRENT FreeBSD 7.0-CURRENT #4: =
 Wed Jan 25 21:16:02 CET 2006 root@vimes.studby.ntnu.no:/usr/obj/usr/src/sys=
 /VIMES i386
 >=20
 >=20
 > =09
 > >Description:
 > 	When i try to install 6.1-BETA1 and choose to use DHCP to configure my
 > 	rl0 interface, i get an error saying "ifconfig: DHCP: bad value" coming
 > 	from the installer trying to run ifconfig rl0 DHCP.
 >=20
 > 	I looked at the code in network.c in sysinstall, and found a difference
 > 	between CURRENT and BETA1, which was an strstr check being changed.
 > 	Patch added below.
 > =09
 > >How-To-Repeat:
 > 	Try install 6.1-BETA1 and configure network interface with DHCP
 > =09
 > >Fix:
 >=20
 > =09
 >=20
 > --- sysinstall_dhcpconfig.diff begins here ---
 > Index: network.c
 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 > RCS file: /home/cvs/ncvs/src/usr.sbin/sysinstall/network.c,v
 > retrieving revision 1.51
 > diff -u -r1.51 network.c
 > --- network.c	1 Nov 2002 02:05:05 -0000	1.51
 > +++ network.c	10 Feb 2006 18:37:24 -0000
 > @@ -126,7 +126,7 @@
 >      snprintf(ifconfig, 255, "%s%s", VAR_IFCONFIG, dev->name);
 >      cp =3D variable_get(ifconfig);
 >      if (cp) {
 > -	if (strcmp(cp, "DHCP")) {
 > +	if (strcmp(cp, "DHCP") =3D=3D NULL) {
 >  	    msgDebug("ifconfig %s %s\n", dev->name, cp);
 >  	    i =3D vsystem("ifconfig %s %s", dev->name, cp);
 >  	    if (i) {
 > --- sysinstall_dhcpconfig.diff ends here ---
 >=20
 >=20
 When i look more at it, strcmp should be replaced with strstr...
 --=20
 Mvh Ulf Lilleengen
 
 --pWyiEgJYm5f9v55/
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.0 (GNU/Linux)
 
 iD8DBQFD7OINCILg8nMIdCURAigkAJ9oUBPTKzk7DIXNDp83lmVL514XbQCeMeas
 YduWzyEWgyeJUxIg+86ri5E=
 =Trcp
 -----END PGP SIGNATURE-----
 
 --pWyiEgJYm5f9v55/--

From: Brooks Davis <brooks@one-eyed-alien.net>
To: Ulf Lilleengen <lulf@stud.ntnu.no>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/93145: [PATCH] 6.1-BETA1 DHCP config error
Date: Fri, 10 Feb 2006 11:57:42 -0800

 > --- sysinstall_dhcpconfig.diff begins here ---
 > Index: network.c
 > ===================================================================
 > RCS file: /home/cvs/ncvs/src/usr.sbin/sysinstall/network.c,v
 > retrieving revision 1.51
 > diff -u -r1.51 network.c
 > --- network.c	1 Nov 2002 02:05:05 -0000	1.51
 > +++ network.c	10 Feb 2006 18:37:24 -0000
 > @@ -126,7 +126,7 @@
 >      snprintf(ifconfig, 255, "%s%s", VAR_IFCONFIG, dev->name);
 >      cp = variable_get(ifconfig);
 >      if (cp) {
 > -	if (strcmp(cp, "DHCP")) {
 > +	if (strcmp(cp, "DHCP") == NULL) {
 >  	    msgDebug("ifconfig %s %s\n", dev->name, cp);
 >  	    i = vsystem("ifconfig %s %s", dev->name, cp);
 >  	    if (i) {
 > --- sysinstall_dhcpconfig.diff ends here ---
 
 This change is wrong on two lecels.  First, comparing the output of
 strcmp to a pointer (NULL) is wrong.  Second, you only want to execute
 the block associated with this if statement when cp is not DHCP which is
 what the code does.  The bug in the code is treating strcmp's return as
 a bool.
 
 -- Brooks
Responsible-Changed-From-To: freebsd-bugs->freebsd-qa 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Feb 11 04:28:46 UTC 2006 
Responsible-Changed-Why:  
Over to maintainer(s), but note that feedback has suggested that this is 
the wrong solution. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=93145 

From: Ceri Davies <ceri@submonkey.net>
To: Mark Linimon <linimon@FreeBSD.org>
Cc: freebsd-bugs@FreeBSD.org,
 freebsd-qa@FreeBSD.org
Subject: Re: bin/93145: [sysinstall] [patch] 6.1-BETA1 DHCP config error
Date: Sat, 11 Feb 2006 14:23:42 +0000

 This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
 --Apple-Mail-2-299884461
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
 
 As the submitter notes, this is already fixed in CURRENT.
 The patch submitted with the PR is not the patch from CURRENT, so  
 yes, it's wrong.
 
 This patch is already with re@ for MFC approval, so this will be  
 taken care of for BETA2.
 
 Thanks.
 
 Ceri
 
 --Apple-Mail-2-299884461
 content-type: application/pgp-signature; x-mac-type=70674453;
 	name=PGP.sig
 content-description: This is a digitally signed message part
 content-disposition: inline; filename=PGP.sig
 content-transfer-encoding: 7bit
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.1 (Darwin)
 
 iD8DBQFD7fWGme8yCsQvJJ0RAthfAJ91xZMamIhzDbY5FPEahWs4vZ/GbgCdGtAU
 iXIwzCg1rNi+IMf8AQaeOxk=
 =1CGY
 -----END PGP SIGNATURE-----
 
 --Apple-Mail-2-299884461--
State-Changed-From-To: open->patched 
State-Changed-By: ceri 
State-Changed-When: Sat Feb 11 14:41:59 UTC 2006 
State-Changed-Why:  
Already patched in -HEAD.   Not sure why the submitter sent in a 
different patch, but thanks for the submission anyway. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=93145 
State-Changed-From-To: patched->closed 
State-Changed-By: ceri 
State-Changed-When: Sun Feb 12 23:49:04 UTC 2006 
State-Changed-Why:  
This was MFCd today. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=93145 
>Unformatted:
