Date: Wed, 3 Mar 2004 20:25:03 +0300 (MSK) From: Yar Tikhiy <yar@comp.chem.msu.su> To: FreeBSD-gnats-submit@FreeBSD.org Subject: conf/63700: Double configuration of cloned_interfaces if network_interfaces=auto Message-ID: <200403031725.i23HP3Db000736@stylish.chem.msu.su> Resent-Message-ID: <200403031730.i23HUGEx057017@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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 <full-duplex>) status: active lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 inet 127.0.0.1 netmask 0xff000000 vlan99: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200403031725.i23HP3Db000736>