From jau@cs78135006.pp.htv.fi  Sun Aug 24 01:17:47 2003
Return-Path: <jau@cs78135006.pp.htv.fi>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id EB7D116A4BF
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 24 Aug 2003 01:17:47 -0700 (PDT)
Received: from cs78135006.pp.htv.fi (cs78135006.pp.htv.fi [62.78.135.6])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6CD9A43FEA
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 24 Aug 2003 01:17:42 -0700 (PDT)
	(envelope-from jau@cs78135006.pp.htv.fi)
Received: (from root@localhost)
	by hvergelmir.thunderbolt.fi (8.12.9/8.11.3) id h7O7sTLc000737;
	Sun, 24 Aug 2003 10:54:29 +0300 (EEST)
	(envelope-from jau)
Message-Id: <200308240754.h7O7sTLc000737@hvergelmir.thunderbolt.fi>
Date: Sun, 24 Aug 2003 10:54:29 +0300 (EEST)
From: "Jukka A. Ukkonen" <jau@mawit.com>
Reply-To: "Jukka A. Ukkonen" <jau@mawit.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: tun# devices cannot be created in 4.8-STABLE
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         55917
>Category:       kern
>Synopsis:       tun# devices cannot be created in 4.8-STABLE
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 24 01:20:16 PDT 2003
>Closed-Date:    Fri Dec 29 19:45:40 GMT 2006
>Last-Modified:  Fri Dec 29 19:45:40 GMT 2006
>Originator:     Jukka A. Ukkonen
>Release:        FreeBSD 4.8-STABLE i386
>Organization:
Mawit Ltd.
>Environment:
System: FreeBSD hvergelmir.thunderbolt.fi 4.8-STABLE FreeBSD 4.8-STABLE #0: Sun Aug 24 10:15:57 EEST 2003 root@hvergelmir.thunderbolt.fi:/usr/src/sys/compile/hvergelmir i386


>Description:
	It does not seem to make any difference whether one configures
	pseudo-device  tun
	in the kernel or not. When trying ifconfig -a no tun# devices
	are listed. Creating one with ifconfig tun0 create fails.
	When trying kldload /modules/if_tun.ko kernel complains that
	the device or module is already present. (Which it should be
	of course when compiled in the config phase.)

>How-To-Repeat:
	# kldstat
	    Should show no if_tun.ko.
	# ifconfig -a
	    Should show no tun0 etc.
	# ifconfig tun0 create
	    Fails complaining about SIOCIFCREATE and wrong argument.
	# kldload /modules/if_tun.ko
	    Complaint about the module already being present.

>Fix:
	None known yet.

	The symptoms make me suspect the call parameters to ioctl
	SIOCIFCREATE might have changed in the kernel, but the
	user-land has not kept up. - This guess might be totally
	in the woods. It is just the first potential explanation
	that occured to me.


>Release-Note:
>Audit-Trail:

From: Pawel Malachowski <pawmal-posting@freebsd.lublin.pl>
To: "Jukka A. Ukkonen" <jau@mawit.com>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: kern/55917: tun# devices cannot be created in 4.8-STABLE
Date: Sun, 24 Aug 2003 10:41:52 +0200

 On Sun, Aug 24, 2003 at 10:54:29AM +0300, Jukka A. Ukkonen wrote:
 
 > >How-To-Repeat:
 > 	# kldstat
 > 	    Should show no if_tun.ko.
 > 	# ifconfig -a
 > 	    Should show no tun0 etc.
 > 	# ifconfig tun0 create
 > 	    Fails complaining about SIOCIFCREATE and wrong argument.
 > 	# kldload /modules/if_tun.ko
 > 	    Complaint about the module already being present.
 
 And how about trying something like:
 	echo '' > /dev/tun0
 
 
 -- 
 Pawe Maachowski

From: "Jukka A. Ukkonen" <ext-Jukka.Ukkonen@nokia.com>
To: freebsd-gnats-submit@freebsd.org
Cc: jau@mawit.com
Subject: Re: kern/55917: tun# devices cannot be created in 4.8-STABLE
Date: Mon, 25 Aug 2003 17:20:41 +0300

 	Aha!! - This was not properly documented!
 
 	A normal user cannot echo or cat anything to /dev/tun#
 	(which seems to be expected).
 	For root it works and the interfaces promptly appear
 	also in the ifconfig list. Because there is the create
 	parameter for ifconfig and other dynamically instantiated
 	interfaces obey this method, it would be the natural way
 	to create an interface and set its address, netmask, etc.
 	also for the tun driver.
 
 	This starts to look much more like two separate issues.
 	Partly this falls back to sloppy documentation instead
 	of a software bug. OTOH it would be a good idea to add
 	support for the create ioctl to the tun driver to make
 	it work the same way as all the other drivers which are
 	instantiated as needed.
 
 	The manual pages do not even hint to the fact that the
 	tun# interfaces cannot be created with ifconfig at the
 	moment. Neither is there any hint that the interface is
 	created when the control device is opened.
 
 	Too bad I am writing this exactly the day when the freeze
 	period for 4.9 is supposed to begin. I guess now there
 	is no chance to get extended ioctl support or manual page
 	changes done before 4.9 goes out.
 
 -- 
 	Cheers,
 		// jau
 
 	A computer, to print out a fact,
 	will divide, multiply, and subtract.
 	But this output can be
 	no more than debris,
 	if the input was short of exact.
 			-- Gigo
 
 

From: "Jukka A. Ukkonen" <ext-jukka.ukkonen@nokia.com>
To: freebsd-gnats-submit@freebsd.org, jau@mawit.com
Cc:  
Subject: Re: kern/55917: tun# devices cannot be created in 4.8-STABLE
Date: Wed, 27 Aug 2003 15:18:07 +0300

 	Also it should be noted that failing to create the tun#
 	interfaces with ifconfig creates a chicken and egg problem
 	when the devfs becomes the default /dev replacing the
 	current statically created device nodes. Then the only way
 	to make some tun# devices visible in the /dev would be
 	a line like
 
 	pseudo-device tun	4	# create 4 tunnel devices
 
 	specifying a predefined number of tun# devices in the kernel
 	config.
 
 	If the devices were created using ifconfig, there would
 	be no problem, because a new master device could appear
 	automatically in the devfs after the ifconfig create
 	command.
 
 -- 
 	Cheers,
 		// jau
 
 	A computer, to print out a fact,
 	will divide, multiply, and subtract.
 	But this output can be
 	no more than debris,
 	if the input was short of exact.
 			-- Gigo
 
 
State-Changed-From-To: open->closed 
State-Changed-By: remko 
State-Changed-When: Fri Dec 29 19:45:38 UTC 2006 
State-Changed-Why:  
Hello, tun device creation works fine now (ifconfig tun0 create gives me 
a tun0 interface), also devfs took over the world and manages this now. 
If I am wrong, please contact me and we will see how we can resolve 
this. thanks for submitting the information though! 

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