From owner-freebsd-bugs@FreeBSD.ORG Wed Mar 3 09:30:16 2004 Return-Path: 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 D055316A4CF for ; Wed, 3 Mar 2004 09:30:16 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id B974D43D45 for ; Wed, 3 Mar 2004 09:30:16 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i23HUGbv057018 for ; Wed, 3 Mar 2004 09:30:16 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i23HUGEx057017; Wed, 3 Mar 2004 09:30:16 -0800 (PST) (envelope-from gnats) Resent-Date: Wed, 3 Mar 2004 09:30:16 -0800 (PST) Resent-Message-Id: <200403031730.i23HUGEx057017@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, Yar Tikhiy Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6E76516A4D1 for ; Wed, 3 Mar 2004 09:25:14 -0800 (PST) Received: from stylish.chem.msu.su (stylish.chem.msu.su [158.250.32.111]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9F24943D41 for ; Wed, 3 Mar 2004 09:25:12 -0800 (PST) (envelope-from yar@stylish.chem.msu.su) Received: from stylish.chem.msu.su (localhost [127.0.0.1]) by stylish.chem.msu.su (8.12.11/8.12.11) with ESMTP id i23HP36p000737 for ; Wed, 3 Mar 2004 20:25:03 +0300 (MSK) (envelope-from yar@stylish.chem.msu.su) Received: (from yar@localhost) by stylish.chem.msu.su (8.12.11/8.12.11/Submit) id i23HP3Db000736; Wed, 3 Mar 2004 20:25:03 +0300 (MSK) (envelope-from yar) Message-Id: <200403031725.i23HP3Db000736@stylish.chem.msu.su> Date: Wed, 3 Mar 2004 20:25:03 +0300 (MSK) From: Yar Tikhiy To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: conf/63700: Double configuration of cloned_interfaces if network_interfaces=auto X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2004 17:30:16 -0000 >Number: 63700 >Category: conf >Synopsis: Double configuration of cloned_interfaces if network_interfaces=auto >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Mar 03 09:30:16 PST 2004 >Closed-Date: >Last-Modified: >Originator: Yar Tikhiy >Release: FreeBSD 5.2-CURRENT i386 >Organization: Moscow State University >Environment: System: FreeBSD stylish.chem.msu.su 5.2-CURRENT FreeBSD 5.2-CURRENT #1: Wed Mar 3 17:07:22 MSK 2004 yar@stylish.chem.msu.su:/usr/obj/usr/src/sys/STYLISH i386 >Description: If the rc.conf(5) variable network_interfaces is set to "auto", its default value, interfaces listed in cloned_interfaces will be doubly configured and their post-configuration status will be displayed twice. That is because the rc function network.subr:list_net_interfaces() doesn't check if the interfaces listed in cloned_interfaces have already been created--the function just concatenates the value of cloned_interfaces to output from `ifconfig -l`, which may include the names of the cloned interfaces, too. >How-To-Repeat: Leave out network_interfaces from rc.conf, thus depending on the rc system to figure out the list of existing interfaces. In addition, specify some interfaces to clone through cloned_interfaces. Observe the results to doubly configure the latter interfaces in rc(8) output. For example: %%% rc.conf snippet %%% ### network_interfaces="lo0 fxp0" cloned_interfaces="vlan99" ifconfig_fxp0="inet 158.250.XX.XX netmask 255.255.255.224" ifconfig_vlan99="inet 192.168.XX.XX netmask 255.255.255.0 vlan 99 vlandev fxp1" %%% rc(8) output %%% vlan99: bpf attached ifconfig: SIOCSETVLAN: Device busy fxp0: flags=8843 mtu 1500 inet 158.250.32.111 netmask 0xffffffe0 broadcast 158.250.32.127 ether 00:04:ac:98:a7:b9 media: Ethernet autoselect (100baseTX ) status: active lo0: flags=8049 mtu 16384 inet 127.0.0.1 netmask 0xff000000 vlan99: flags=8843 mtu 1500 inet 169.254.1.1 netmask 0xffff0000 broadcast 169.254.255.255 ether 00:90:27:a6:97:e9 media: Ethernet autoselect (none) status: no carrier vlan: 99 parent interface: fxp1 vlan99: flags=8843 mtu 1500 inet 169.254.1.1 netmask 0xffff0000 broadcast 169.254.255.255 ether 00:90:27:a6:97:e9 media: Ethernet autoselect (none) status: no carrier vlan: 99 parent interface: fxp1 %%% end of example %%% Things to note are: (1) "SIOCSETVLAN: Device busy" from ifconfig when it tried to set VLAN parameters on vlan99 for the second time; (2) vlan99 appearing twice in the status display. >Fix: I can see a few ways to address this issue: (1) list_net_interfaces() could eliminate duplicates from the list of interface names to return. (2) The automatic list of interfaces could be saved early, before cloning. (3) A flag variable could be introduced to tell whether cloned interfaced have been created. Each route is easy to implement, but I'm afraid I don't know the internals of rcNG well enough to choose the best one. >Release-Note: >Audit-Trail: >Unformatted: