From nobody@FreeBSD.org Mon Aug 10 13:45:09 2009 Return-Path: Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BE6F106566C for ; Mon, 10 Aug 2009 13:45:09 +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 2AEAD8FC50 for ; Mon, 10 Aug 2009 13:45:09 +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 n7ADj8Iu067511 for ; Mon, 10 Aug 2009 13:45:08 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n7ADj8ok067510; Mon, 10 Aug 2009 13:45:08 GMT (envelope-from nobody) Message-Id: <200908101345.n7ADj8ok067510@www.freebsd.org> Date: Mon, 10 Aug 2009 13:45:08 GMT From: Vladimir Shebaldenkov To: freebsd-gnats-submit@FreeBSD.org Subject: Various problems with "vlan_device.vlan_id" syntax X-Send-Pr-Version: www-3.1 X-GNATS-Notify: >Number: 137641 >Category: bin >Synopsis: ifconfig(8): various problems with "vlan_device.vlan_id" syntax >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-net >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Aug 10 13:50:00 UTC 2009 >Closed-Date: >Last-Modified: Mon Aug 10 18:40:01 UTC 2009 >Originator: Vladimir Shebaldenkov >Release: 7.2-RELEASE >Organization: Stenos >Environment: FreeBSD stenos.net.ua 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Fri May 1 08:49:13 UTC 2009 root@walker.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: "Since FreeBSD 5.3 a vlan device can be created and configured with one command: ifconfig vlan_device.vlan_id create" Quote from here - http://people.freebsd.org/~arved/vlan/vlan_en.html This is so, but have some problems with ifconfig and rc scripts. 1. ifconfig does not load if_vlan.ko automatically, when using this syntax. Need to add if_vlan_load="YES" into loader.conf 2. /etc/rc.d/netif has a similar with this syntax problem also. And may be similar errors in other places. In rc.conf something like this: cloned_interfaces="xl0.101 xl0.102" ifconfig_xl0_101="inet 10.10.10.1/30" ifconfig_xl0_102="inet 10.10.10.5/30" >How-To-Repeat: # kldstat Id Refs Address Size Name 1 7 0xc0400000 9fab28 kernel # ifconfig vlan101 create # kldstat Id Refs Address Size Name 1 9 0xc0400000 9fab28 kernel 8 1 0xc4329000 5000 if_vlan.ko # kldunload if_vlan # ifconfig xl0.101 create ifconfig: SIOCIFCREATE2: Invalid argument # kldload if_vlan # ifconfig xl0.101 create ----------------------- # kldunload if_vlan # /etc/rc.d/netif restart Stopping network: lo0 xl0. ifconfig: SIOCIFCREATE2: Invalid argument ifconfig: SIOCIFCREATE2: Invalid argument .. # kldload if_vlan # /etc/rc.d/netif restart Stopping network: lo0 xl0. showstat_xl0.101=1: not found showstat_xl0.102=1: not found .. # /etc/rc.d/netif restart Stopping network:showstat_xl0.101=1: not found showstat_xl0.102=1: not found lo0 xl0 xl0.101 xl0.102. ifconfig: SIOCIFCREATE2: File exists ifconfig: SIOCIFCREATE2: File exists showstat_xl0.101=1: not found showstat_xl0.102=1: not found .. >Fix: >Release-Note: >Audit-Trail: Responsible-Changed-From-To: freebsd-bugs->freebsd-net Responsible-Changed-By: remko Responsible-Changed-When: Mon Aug 10 15:36:01 UTC 2009 Responsible-Changed-Why: reassign to networking team http://www.freebsd.org/cgi/query-pr.cgi?pr=137641 From: Artis Caune To: bug-followup@FreeBSD.org, vladimir.shebaldenkov@gmail.com Cc: Subject: Re: bin/137641: ifconfig(8): various problems with "vlan_device.vlan_id" syntax Date: Mon, 10 Aug 2009 21:33:20 +0300 --0016e659fbf0f99c790470cdd17e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, attached patch should fix automatic loading of if_vlan when creating interface as device.vlan_id and vlan module is not loaded. -- Artis Caune Everything should be made as simple as possible, but not simpler. --0016e659fbf0f99c790470cdd17e Content-Type: text/plain; charset=US-ASCII; name="device.vlan_id.patch.txt" Content-Disposition: attachment; filename="device.vlan_id.patch.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fy7jgzm40 SW5kZXg6IGlmY29uZmlnLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gaWZjb25maWcuYwkocmV2aXNpb24gMTk2 MDQ3KQorKysgaWZjb25maWcuYwkod29ya2luZyBjb3B5KQpAQCAtOTk4LDYgKzk5OCwxMCBAQAog CQkJYnJlYWs7CiAJCX0KIAorCS8qIHRyeSB0byBsb2FkIHZsYW4gbW9kdWxlIGlmIGludGVyZmFj ZSBuYW1lIGlzIGRldmljZS52bGFuX2lkICovCisJaWYgKGluZGV4KG5hbWUsICcuJykgIT0gTlVM TCkKKwkJc3RybGNweShpZm5hbWUsICJ2bGFuIiwgc2l6ZW9mKGlmbmFtZSkpOworCiAJLyogdHVy biBpbnRlcmZhY2UgYW5kIHVuaXQgaW50byBtb2R1bGUgbmFtZSAqLwogCXN0cmNweShpZmtpbmQs ICJpZl8iKTsKIAlzdHJsY3B5KGlma2luZCArIE1PRF9QUkVGSVhfTEVOLCBpZm5hbWUsCg== --0016e659fbf0f99c790470cdd17e-- >Unformatted: