From owner-freebsd-bugs@FreeBSD.ORG Sun Mar 14 05:20:04 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6B241065673 for ; Sun, 14 Mar 2010 05:20:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A3E398FC0C for ; Sun, 14 Mar 2010 05:20:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o2E5K3jV022391 for ; Sun, 14 Mar 2010 05:20:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o2E5K3IL022390; Sun, 14 Mar 2010 05:20:03 GMT (envelope-from gnats) Resent-Date: Sun, 14 Mar 2010 05:20:03 GMT Resent-Message-Id: <201003140520.o2E5K3IL022390@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Garrett Cooper Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23793106566B for ; Sun, 14 Mar 2010 05:12:07 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 136CE8FC0A for ; Sun, 14 Mar 2010 05:12:07 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o2E5C6xL036781 for ; Sun, 14 Mar 2010 05:12:06 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o2E5C6no036752; Sun, 14 Mar 2010 05:12:06 GMT (envelope-from nobody) Message-Id: <201003140512.o2E5C6no036752@www.freebsd.org> Date: Sun, 14 Mar 2010 05:12:06 GMT From: Garrett Cooper To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: conf/144726: network.subr functions accumulate output before r197139 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Mar 2010 05:20:04 -0000 >Number: 144726 >Category: conf >Synopsis: network.subr functions accumulate output before r197139 >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Mar 14 05:20:03 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Garrett Cooper >Release: RELENG_8 >Organization: Cisco Systems, Inc. >Environment: FreeBSD foo.localdomain 8.0-STABLE FreeBSD 8.0-STABLE #1 r204854M: Fri Mar 12 22:21:06 PST 2010 root@:/usr/obj/scratch/ip-thinclient-test/releng_8/sys/GENERIC amd64 >Description: On a system prior to r197319, any given time that list_net_interfaces is run more than once, the list grows as the variables in list_net_interfaces after that commit is a local and not a global variable. Example (RELENG_8): # . /etc/rc.subr ; . /etc/network.subr ; . /etc/defaults/rc.conf ; list_net_interfaces lo0 lo0 lo0 lo0 plip0 bge0 bge1plip0 bge0 bge1plip0 bge0 bge1 # uname -a FreeBSD foo.localdomain 8.0-STABLE FreeBSD 8.0-STABLE #1 r204854M: Fri Mar 12 22:21:06 PST 2010 root@:/usr/obj/scratch/ip-thinclient-test/releng_8/sys/GENERIC amd64 Example (9-CURRENT): [gcooper@bayonetta /scratch/src/head/usr.bin/hexdump]$ . /etc/rc.subr ; . /etc/network.subr ; . /etc/defaults/rc.conf ; list_net_interfaces lo0 em0 fwe0 [gcooper@bayonetta /scratch/src/head/usr.bin/hexdump]$ uname -a FreeBSD bayonetta.localdomain 9.0-CURRENT FreeBSD 9.0-CURRENT #2: Thu Mar 4 13:16:39 PST 2010 gcooper@bayonetta.localdomain:/usr/obj/usr/src/sys/BAYONETTA amd64 It would be nice if this variable scoping was properly backported so others could use the functions more than once without unsetting the variables beforehand (it saves me from duplicating network interface detection in a script I'm using). >How-To-Repeat: 1. Use a system based off of sources prior to r197319. 2. Execute: . /etc/rc.subr ; . /etc/network.subr ; . /etc/defaults/rc.conf ; list_net_interfaces >Fix: MFC the code in r197139 (it was supposed to be MFCed after 3 days according to the commit email: http://svn.freebsd.org/changeset/base/197139 ). >Release-Note: >Audit-Trail: >Unformatted: