From yar@bsd.chem.msu.ru  Mon Nov 27 22:40:42 2006
Return-Path: <yar@bsd.chem.msu.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 30D4516A492
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 27 Nov 2006 22:40:42 +0000 (UTC)
	(envelope-from yar@bsd.chem.msu.ru)
Received: from bsd.chem.msu.ru (bsd.chem.msu.ru [195.208.208.23])
	by mx1.FreeBSD.org (Postfix) with ESMTP id E4AB344C4B
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 27 Nov 2006 22:08:41 +0000 (GMT)
	(envelope-from yar@bsd.chem.msu.ru)
Received: from bsd.chem.msu.ru (localhost [127.0.0.1])
	by bsd.chem.msu.ru (8.13.4/8.13.3) with ESMTP id kARM9PQW012201
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 28 Nov 2006 01:09:26 +0300 (MSK)
	(envelope-from yar@bsd.chem.msu.ru)
Received: (from yar@localhost)
	by bsd.chem.msu.ru (8.13.4/8.13.3/Submit) id kARM9P3e012200;
	Tue, 28 Nov 2006 01:09:25 +0300 (MSK)
	(envelope-from yar)
Message-Id: <200611272209.kARM9P3e012200@bsd.chem.msu.ru>
Date: Tue, 28 Nov 2006 01:09:25 +0300 (MSK)
From: Yar Tikhiy <yar@comp.chem.msu.su>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Regression in ifconfig(8) + vlan(4)
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         105925
>Category:       bin
>Synopsis:       problems with ifconfig(8) and vlan(4) [regression]
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-net
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 27 22:50:13 GMT 2006
>Closed-Date:    
>Last-Modified:  Mon May 05 01:23:26 UTC 2008
>Originator:     Yar Tikhiy
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
none
>Environment:
System: FreeBSD dg.local 7.0-CURRENT FreeBSD 7.0-CURRENT #17: Sun Nov 26
        20:19:14 MSK 2006 yar@dg.local:/usr/obj/usr/src/sys/GENERIC i386

>Description:

	After the introduction of SIOCSIFCREATE2 and respective changes
	to ifconfig(8), some valid ifconfig command lines started to fail.

>How-To-Repeat:

Checked out ifconfig dated just before the change: 2006.07.09.00.00.00.
Compiled it all right.
Using it:

	dg# ./ifconfig vlan77 create vlan 77 vlandev xl0 up
	dg# ./ifconfig vlan77
	vlan77: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
		ether 00:50:04:9d:be:f1
		media: Ethernet autoselect (100baseTX <full-duplex>)
		status: active
		vlan: 77 parent interface: xl0
	dg# ./ifconfig vlan77 destroy

	dg# ./ifconfig vlan77 create vlan 77 vlandev xl0 mtu 1006 up
	dg# ./ifconfig vlan77
	vlan77: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1006
		ether 00:50:04:9d:be:f1
		media: Ethernet autoselect (100baseTX <full-duplex>)
		status: active
		vlan: 77 parent interface: xl0
	dg# ./ifconfig vlan77 destroy

All OK...

Now using the stock ifconfig:

	dg# ifconfig vlan77 create vlan 77 vlandev xl0 up
	ifconfig: ioctl (SIOCGIFFLAGS): no such interface

	dg# ifconfig vlan77 create vlan 77 vlandev xl0 mtu 1006 up
	ifconfig: ioctl (set mtu): Device not configured
	ifconfig: ioctl (SIOCGIFFLAGS): no such interface

	dg# ifconfig vlan77
	ifconfig: interface vlan77 does not exist

Total failure, the interface wasn't created at all.

>Fix:
>Release-Note:
>Audit-Trail:

From: Yar Tikhiy <yar@comp.chem.msu.su>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: kern/105925: Regression in ifconfig(8) + vlan(4)
Date: Tue, 28 Nov 2006 02:23:15 +0300

 In addition, it can be proved that the bug is caused or triggered
 by the SIOCSIFCREATE2 change and not another change: cvs update of
 ifconfig to time right after the change results in the buggy behaviour
 described in this PR.
 
 -- 
 Yar

From: Bruce M Simpson <bms@incunabulum.net>
To: freebsd-gnats-submit@FreeBSD.org
Cc: Yar Tikhiy <yar@comp.chem.msu.su>
Subject: Re: kern/105925: Regression in ifconfig(8) + vlan(4)
Date: Sat, 10 Feb 2007 20:14:47 +0000

 Any progress on this change?
 
 P.S. For the GNATS record it is spelt SIOCIFCREATE2
 
 BMS

From: Yar Tikhiy <yar@comp.chem.msu.su>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/105925: Regression in ifconfig(8) + vlan(4)
Date: Sat, 2 Jun 2007 19:43:42 +0400

 It appears that this problem is not limited to vlan(4), any cloned
 interface can suffer from it.  The cause of the problem hides in
 rev. 1.2 of sbin/ifconfig/ifclone.c.  Due to that change, interface
 creation is handled now by a callback, which is invoked after all
 parameters were processed.  E.g., if one writes "ifconfig lo5 create
 mtu 1500 up", ifconfig will try to set the mtu and flags from the
 main command loop and fail before the create callback has a chance
 to bring the interface into existence.
 
 A possible workaround for vlan(4) is to avoid such parameters as
 "mtu" or "up" in "ifconfig vlanX create ...".  The "vlan" and
 "vlandev" parameters are processed from a callback, too, so they
 don't fail.  I.e., the following command will work:
 
 ifconfig vlan55 create 10.55.55.1/24 vlan 55 vlandev em0
 
 Note that you don't need an explicit "up" as long as an IP address
 is assigned to the interface -- the IP layer will bring it up anyway.
 
 -- 
 Yar
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon May 5 01:10:38 UTC 2008 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=105925 
>Unformatted:
