Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Dec 2000 15:46:04 -0600
From:      Bill Fumerola <billf@mu.org>
To:        Dan Phoenix <dphoenix@bravenet.com>
Cc:        Poul-Henning Kamp <phk@critter.freebsd.dk>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: Tun driver?
Message-ID:  <20001216154604.A72273@elvis.mu.org>
In-Reply-To: <Pine.BSO.4.21.0012140759580.10163-100000@gandalf.bravenet.com>; from dphoenix@bravenet.com on Thu, Dec 14, 2000 at 08:00:18AM -0800
References:  <4581.976715688@critter> <Pine.BSO.4.21.0012140759580.10163-100000@gandalf.bravenet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Dec 14, 2000 at 08:00:18AM -0800, Dan "Mahir" Phoenix wrote:
> what you mean device side?
> you mean server side?

He meant exactly what he said:

[billf.yahoo-root 16:26:00]
< /dev # ifconfig tun0
ifconfig: interface tun0 does not exist
[billf.yahoo-root 16:26:09]
< /dev # dd if=/dev/tun0 of=/dev/null count=0
0+0 records in
0+0 records out
0 bytes transferred in 0.000014 secs (0 bytes/sec)
[billf.yahoo-root 16:26:18]
< /dev # ifconfig tun0
tun0: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
[billf.yahoo-root 16:26:20]
< /dev #

Some program needs to open() the device for it to register.
The following snippet of code (around line 155 of sys/net/if_tun.c)
is relevant:
        tp = dev->si_drv1;
        if (!tp) {
                tuncreate(dev);
                tp = dev->si_drv1;
        }

.. and tuncreate() sets up the device and if_attach()s the driver,
which makes it appear in the list ifconfig works off of.

-- 
Bill Fumerola - security yahoo         / Yahoo! inc.
              - fumerola@yahoo-inc.com / billf@FreeBSD.org





To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001216154604.A72273>