From owner-freebsd-bugs@FreeBSD.ORG Fri Feb 10 20:00:24 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 421FC16A422 for ; Fri, 10 Feb 2006 20:00:24 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6C81743D48 for ; Fri, 10 Feb 2006 20:00:22 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k1AK0Mwp013682 for ; Fri, 10 Feb 2006 20:00:22 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k1AK0M0G013681; Fri, 10 Feb 2006 20:00:22 GMT (envelope-from gnats) Date: Fri, 10 Feb 2006 20:00:22 GMT Message-Id: <200602102000.k1AK0M0G013681@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Brooks Davis Cc: Subject: Re: bin/93145: [PATCH] 6.1-BETA1 DHCP config error X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Brooks Davis List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2006 20:00:24 -0000 The following reply was made to PR bin/93145; it has been noted by GNATS. From: Brooks Davis To: Ulf Lilleengen 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